Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

Openssl: Commandline base64 string encoding
https://forum.ivorde.com/openssl-commandline-base64-string-encoding-t63.html
Page 1 of 1

Author:  debuser [ Fri Mar 05, 2010 11:50 am ]
Post subject:  Openssl: Commandline base64 string encoding

To encode a string into base64, echo and openssl system utilities can be used:
Code:
# echo -n 'somepassword' | openssl enc -base64
c29tZXBhc3N3b3Jk


The -n switch to echo is used to supress echoing a new line character. For example, below is a difference between base64 encoded string that doesn't contain newline and on that does:
Code:
# echo -n 'somepassword' | openssl enc -base64
c29tZXBhc3N3b3Jk
# echo 'somepassword' | openssl enc -base64
c29tZXBhc3N3b3JkCg==

Author:  admin [ Wed Nov 09, 2011 11:07 am ]
Post subject:  Re: Openssl: Commandline base64 string encoding

Update: also the "base64" utility can be used:
Code:
#echo 'somepassword' | base64
c29tZXBhc3N3b3JkCg==


This utility needs to be installed separately on FreeBSD/Debian.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/