Skip to content
This repository

Secures ActiveRecord attributes with public key encryption

tree: 4214543263

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 rails Initial setup March 17, 2009
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE Initial setup March 17, 2009
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb Initial setup March 17, 2009
Octocat-spinner-32 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.