added base64 encoding to crypto