Module ActiveCrypto::ClassMethods
In: lib/active_crypto.rb

Usage is very simple. You will generally only need the two class methods listed here in your ActiveRecord class model.

License

ActiveCrypto and EzCrypto are released under the MIT license.

Support

To contact the author, send mail to pelleb@gmail.com

Also see my blogs at: stakeventures.com and neubia.com

This project was based on code used in my project StakeItOut, where you can securely share web services with your partners. stakeitout.com

(C) 2005 Pelle Braendgaard

Methods

encrypt   keyholder  

Included Modules

ActiveCrypto::Encrypted ActiveCrypto::AssociationKeyHolder

Public Instance methods

Turn encryption on for this record. List all encrypted attributes

  class Document < ActiveRecord::Base
                encrypt :title,:body
        end

Include optional option :key, to specify an external KeyHolder, which holds the key used for encrypting and decrypting:

  class Document < ActiveRecord::Base
        belongs_to :user
        encrypt :title,:body,:key=>:user
  end

Creates support in this class for holding a key. Adds the following methods:

  • enter_password(password,salt="onetwothree")
  • set_session_key(key)
  • session_key

Use it as follows:

  class User < ActiveRecord::Base
        has_many :documents
        keyholder
  end

[Validate]