Aaron's encryption/decryption Ruby scriptFileSafe
Photo: March SunsetIPv4You are not logged in. Click here to log in.
FileSafe -- A simple Ruby script for encrypting/decrypting files using 256-bit AES and a master key derived from a password/passphrase via the PBKDF2 function.
I wrote this script for use on several systems where I needed to regularly encrypt/decrypt one or more files using a password or passphrase. The method used should be reasonably secure for the uses I required. I have NOT adapted the script (yet) for non-POSIX environments (Windows) however.
This script was originally written and tested using Ruby 1.9.x. No attempts to adapt or test it under earlier Ruby versions were made. It has since been used under Ruby 2.0 (as of version 3.1.0 of the gem). It requires/relies on: OpenSSL (encryption/HMAC/hash algorithms), securerandom (cryptographically secure random data), the ruby-pbkdf2 gem (for the password-based key derivitive function PBKDF2), the highline gem (for reading a password/passphrase from a terminal), and tempfile for temporary file creation.
The latest version is version 3.1.0 released on 04 Feb. 2014.
You can download the latest gem (3.1.0) here:
SHA256 and MD5 sums of the gem are:
You may view the source code here:
This utility script and related library and test files in the gem are licensed under an MIT-style license. (See the LICENSE.txt file.)
Please report bugs by going to the author's web site and clicking on the "Contact Me" link in the left-hand menu. The direct URL is:
-- Aaron D. Gifford