base64 encode/decode tokens