linux poison RSS
linux poison Email

Encrypt-Decrypt file using OpenSSL

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


2 comments:

Ian Dunn said...

When decrypting, you shouldn't enter the password via the command line. It can be seen plain text by anyone standing around and will also be logged in .bash_history.

If you just run "openssl des3 -d -salt -in file.des3 -out file.txt" you'll be prompted for the password safely.

Anonymous said...

nice

Post a Comment

Related Posts with Thumbnails