Encrypt-Decrypt file using OpenSSL

From http://icewalkerz.blogspot.com/2009/10/encrypt-decrypt-file-using-openssl.html

The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library. The project is managed by a worldwide community of volunteers that use the Internet to communicate, plan, and develop the OpenSSL toolkit and its related documentation.

OpenSSL is based on the excellent SSLeay library developed by Eric A. Young and Tim J. Hudson. The OpenSSL toolkit is licensed under an Apache-style licence, which basically means that you are free to get and use it for commercial and non-commercial purposes subject to some simple license conditions.

To encrypt a file:

$ openssl des3 -salt -in file.log -out file.des3
enter des-ede3-cbc encryption password:
Verifying – enter des-ede3-cbc encryption password:

The above will prompt for a password, or you can put it in with a -k option, assuming you’re on a trusted server.

To Decrypt:

$openssl des3 -d -salt -in file.des3 -out file.txt -k mypassword


I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.