Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Secures ActiveRecord attributes with public key encryption
Ruby
tree: 4214543263

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
rails
test
.gitignore
LICENSE
README.textile
Rakefile
init.rb
strongbox.gemspec

README.textile

Strongbox

Public Key Encryption for ActiveRecord.

Gem installation (Rails 2.1+)

In config/environment.rb:

config.gem “spikex-strongbox”, :lib => ‘strongbox’, :source => ‘http://gems.github.com’,

Key Generation

Generate a key pair:

openssl genrsa -des3 -out private.pem 2048
Generating RSA private key, 2048 bit long modulus
……+
.+
e is 65537 (0×10001)
Enter pass phrase for private.pem:
Verifying – Enter pass phrase for private.pem:

and extract the the public key:

openssl rsa -in private.pem -out public.pem -outform PEM -pubout
Enter pass phrase for private.pem:
writing RSA key

Configuration

Strongbox.configure do |config|

config.key_pair = ‘/PATH/TO/KEY_PAIR.pem’
  1. Or:
  2. config.public_key = ‘/PATH/TO/PUBLIC/KEY.pem’
  3. config.private_key = ‘/PATH/TO/PRIVATE/KEY.pem’
  1. Optionally
  1. config.base64 = true # Base64 Encode encrypted data
  2. config.padding = RSA_PKCS1_OAEP_PADDING # Default is RSA_PKCS1_PADDING
  3. config.symmetric_cipher = ‘blowfish-cbc’ # Default is aes-256-cbc

end

Authors

Spike Ilacuqa

Something went wrong with that request. Please try again.