Aaron's encryption/decryption Ruby scriptFileSafe
Photo: Caanan Mountain Above the High Desert PlainIPv4You 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. Version 3.1.0 of the gem was used with Ruby 2.0, 2.1, 2.3, and 2.4.
This gem depends on OpenSSL for encryption, HMAC, has algorithms, and the PBKDF2 algorithm. Older versions of OpenSSL did not include the PBKDF2 algorithm, and so it may not work with those versions. Gem versions 3.1.1 and earlier used the ruby-pbkdf2 gem for PBKDF2. Version 4.0.0 does not. The highline gem is also required for reading password/passphrase information from a terminal. Finally, tempfile is used for temporary file creation.
The latest version is version 4.0.0 released on 23 Feb. 2018.
You can download the latest gem (4.0.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