Skip to content

Instantly share code, notes, and snippets.

@mlsaito mlsaito/base64.txt
Last active May 22, 2018

Embed
What would you like to do?
Convert strings to Base64 encoding in MacOS using OpenSS
Encoding to Base64:
$ echo 'mako@ringcaptcha.com:samplePassword' | openssl base64
> bWFrb0ByaW5nY2FwdGNoYS5jb206c2FtcGxlUGFzc3dvcmQK
Decoding from Base64:
$ echo 'bWFrb0ByaW5nY2FwdGNoYS5jb206c2FtcGxlUGFzc3dvcmQK' | openssl base64 -d
> mako@ringcaptcha.com:samplePassword
@mlsaito

This comment has been minimized.

Copy link
Owner Author

commented May 22, 2018

Helpful for converting account credentials to Base64 for Basic HTTP Header when making HTTP requests.

curl -H "Basic: bWFrb0ByaW5nY2FwdGNoYS5jb206c2FtcGxlUGFzc3dvcmQK" https://someApi.com/getData?id=523

Or you could simply just do:

curl --user "mako@ringcaptcha.com:samplePassword" https://someApi.com/getData?id=523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.