How to Encode and Decode with Base64 and OpenSSL

Encode a string to Base64:

$ echo -n "encode me" | openssl enc -base64

Note: -n removes the newline character added by “echo”.

Decode a base64 to a string:

$ echo "ZW5jb2RlIG1lCg==" | openssl enc -base64 -d

sslLinux

37 Words

2010-07-24 23:11 +0000