In my current project, I’ve had need to encode data in Base64 format for network transmission. Since I don’t want to reimplement things that are already available, I’ve seen libraries like Apache Commons Codec for Java. But I recently stumbled across a neat idea, especially when using shell scripts: OpenSSL can do Base64 encoding. It can do just that by using base64 as a cipher name, or it can use a real encryption cipher and then Base64-encode the encrypted content. Thanks to Van Emery for pointing that out. OpenSSL should be available in almost all Linux/Unix distributions, and can even go on Windows natively or via cygwin.
marcelk.org
tech, life, and more
tech: base64 encoding tools
tech tips marcelk 20 Dec 2007 1 Comment
Bob Callaway responded on 03 Jan 2008 at 3:52 pm #
Note that the input file needs to be wrapped at 64 characters per line, or openssl doesn’t know how to handle it and just quits.
just learned that today