Encode a string
$ echo -n 'Softwaretester.info' | openssl base64 -e
The -n after the echo command, prevents echo from appending a newline character on the end of the string.
Decode a string
$ echo 'U29mdHdhcmV0ZXN0ZXIuaW5mbw==' | openssl base64 -d
Encode content of file
$ openssl base64 -e -in example.txt -out example.b64