I have just released the latest version of EzCrypto which has the new Rails support I mentioned in my last post.
Everything is as transparent as possible. See the EzCrypto docs for more info.
I will try to write a bit more about it later.
Usage patterns
The only thing I just want to write about is that it currently supports the following two usage patterns:
One key one record
@doc=Document.new
@doc.enter_password "my very own secret"
@doc.title="Plan to take over the world"
@doc.save
This is probably not very useful, but it is the simplest of all patterns.
One key many records
This is mirrors a database one to many pattern where the parent has the key and is known in ActiveCrypto as the KeyHolder.
@user=User.new
@user.enter_password
@user.save
@doc=Document.new
@doc.user=@user
@doc.title="Plan to take over the world"
@doc.save
This will probably be the most useful of the two patterns.
Shared Keys
This pattern is not implemented yet in ActiveCrypto, although I do use it in StakeItOut. I am working on a way to simplify the usage of it to make it as easy and straightforward to use as the One key many records pattern. I am guessing version 0.3 will have this.
I welcome feedback. As mentioned I am doing for me some pretty hairy ruby programming linking it into Rails. I would like to hear suggestions from some of the actual Rails frameworks maintainers and others about what could be done to improve it and integrate it even better into rails.
This entry was posted in the following Categories: Crypto & Security , Open Source , Ruby
Hi, this is very similar to my Sentry library. Feel free to take a gander at the source if it'll help: http://sentry.rubyforge.org/
I used Callback objects to hook into ActiveRecord, and use application-wide keys for encryption/decryption.
Posted by: rick on October 31, 2005 09:17 AM