Home

Awesome

Ruby RNCryptor

This is a Ruby port of Rob Napier's Cocoa RNCryptor library. Like RNCryptor, Ruby RNCryptor intends to be an easy-to-use class that correctly handles random initialization vectors, password stretching with PBKDF2, and HMAC verification.

This port is based on his Data Format wiki page. It currently implements version 2 and version 3.

Usage Example:

require './lib/ruby_rncryptor'
require "base64"

password = "n3v3r gue55!!"
encrypted = RubyRNCryptor.encrypt("This is a tiny bit of text to encrypt", password)

puts Base64.encode64(encrypted)
puts "Decrypting..."

decrypted = RubyRNCryptor.decrypt(encrypted, password)

puts decrypted

Release Notes

2017-04-01 - version 3.0.2

2016-01-25 - version 3.0.1

2013-12-20 - version 3.0

Generate and install as a gemfile

gem build ruby_rncryptor.gemspec
gem install ./ruby_rncryptor-3.0.1.gem

Credits