Using OpenSSL on Windows with a USB Drive
by Nathan on Feb.07, 2008, under Uncategorized
The other day I picked up a new 2gb USB Drive. I like to keep storage with me, as well as programs like Portable Putty, Firefox, Filezilla, VLC, 7Zip and KeePass. All of which can be downloaded free at PortableApps.com Keeping all these programs only takes up around 150MB, which isn’t bad when you have 1.9GB to play with. Now lets talk about encryption. Using a Mac or Linux a lot like I do, you find OpenSSL is awesome. You can easily encrypt and decrypt files quickly. I recently got to looking around and found an .exe of OpenSSL. So I started playing. When I was done I had OpenSSL working off a USB Drive, and a batch file that either encrypts or decrypts based on the file extension. Oh and the batch file is run by dropping a file onto it. Here is what I did.
- Download Win32 OpenSSL v0.9.8g Light and install.
- Copy C:\OpenSSL\bin to your USB Drive.
- Rename the bin directory to openssl.
- Copy libssl32.dll, libeay32.dll, msvcr71.dll, ssleay32.dll from C:\WINDOWS\system32 to your new openssl directory.
- Double click on openssl.exe in your openssl directory. If it works you should get a command prompt showing OpenSSL>
- Download this file to the root of your USB Drive. encrypt-and-decrypt.bat
- Now you have drag and drop encryption and decryption using aes-256.
The batch file will encrypt any file but will not encrypt a directory. If you want to encrypt a directory you can use 7zip to zip up the directory, then encrypt the .zip Also the batch file will only decrypt files ending in .enc Test it out and you will see what I mean. If you have any questions just leave a comment.
Thanks
Nathan
ps. If you want separated encrypt and decrypt files you can download these. encrypt.bat decrypt.bat


February 7th, 2008 on 11:33 pm
When you go from decryted -> encrpyted or from decryted -> encrypted, where does it store the output? If it stores it on the flash drive itself, won’t that reduce the lifetime of the drive and also slow the speed of the process?
February 7th, 2008 on 11:44 pm
The batch file’s output is in the same place as the original file.