Base64 encrypt refactored