proper base64 encoding