Showing posts with label encryption. Show all posts
Showing posts with label encryption. Show all posts

Monday, March 14, 2011

Simple command line encryption

Works on OS X, Linux, anywhere with OpenSSL installed:
(NOTE: With OS X Lion breaking TrueCrypt - this is simple replacement that, in a way, simplifies things.)

To encrypt the file:
openssl des3 -salt -in infile.txt -out encryptedfile.txt
To decrypt the file:
openssl des3 -d -salt -in encryptedfile.txt -out normalfile.txt
The -a option, stores the encrypted file in base64 instead of binary.

To encrypt the file stored in base64:
openssl des3 -a -salt -in infile.txt -out encryptedfile.txt
To decrypt the file stored in base64:
openssl des3 -d -a -salt -in encryptedfile.txt -out normalfile.txt
To see a list of all available ciphers and other command information:
openssl -h

Other examples(notes to self...):
openssl des3 -salt -in rev27_*****_2010.zip -out rev27_*****_2010.zip.des3
openssl des3 -salt -in pf_*****_2010.zip -out pf_*****_2010.zip.des3