spikex / strongbox

Secures ActiveRecord attributes with public key encryption
http://stuff-things.net/2009/04/17/introducing-strongbox/
MIT License
398 stars 42 forks source link

Only works on a single field per model #1

Closed theIntuitionist closed 15 years ago

theIntuitionist commented 15 years ago

This code:

class User < ActiveRecord::Base encrypt_with_public_key :first_name, :symmetric => :never, :base64 => true, :public_key => File.join(RAILS_ROOT,'config','public.pem') encrypt_with_public_key :last_name, :symmetric => :never, :base64 => true, :public_key => File.join(RAILS_ROOT,'config','public.pem') end

results in

User.create(:first_name => 'jason', :last_name => 'ward) => #<User id: 2, first_name: nil, last_name: "pMLj/Sa87FgR6mV1et8Hbo6F/eTI/efSgb6qenVVegNVUMEyjz9...", created_at: "2009-10-09 05:05:55", updated_at: "2009-10-09 05:05:55">

spikex commented 15 years ago

This was fixed in version 0.2.0 (0.2.1 is current). However, github gems have been broken since their move to Rackspace, so they haven't updated their copy. You can get the current version from Gemcutter or RubyForge.