shuber/attr_encrypted — pull request #34 by mikehoward (2012-03-15 16:23:37+00:00)
Title: Mikes branch1

Added support for :iv option. Includes (cursory) test, some rewrite of the Rakefile [so I could run a single test w/o installing Datamaper or Sequel], and updates to attr_encrypted.rb.

This works by embedding the :iv value in the encrypted value so that it can be recovered during decryption. That supports dynamic, random :iv generation.

The examples in the doc are tailored for aes-256-cbc, because that's your default and I'm lazy. The algorithm will support an arbitrary size :iv (as long as the length is positive, that is - there is no sanity check for stupidity)

Please look it over before publishing it: I only did a surface scan of the code in order to hack this in.

Regards and thanks for the gem,
Mike