Repository:
http://github.com/toamitkumar/url_encrypt/tree/master
Installation:
.scirpt/plugin install git://github.com/toamitkumar/url_encrypt.git
Usage:
Add the following line to your environment.rb file
UrlEncrypt.encryptors("abcdefghijklmnop", "mnbkjhkhkhkhkhkjhkjh")
#so that KEY and IV for Cipher encryption are different
OR
UrlEncrypt.encryptors("abcdefghijklmnop")
# so that KEY and IV for Cipher encryption are same
OR
NOTHING
Inside your model add the line:
class Book < ActiveRecord::Basecolumn :id, :integer
column :title, :string
encrypted :with => :title
end
You have handy methods:Book.find_by_encrypted_title('encrypted string')
Book.find_by_encrypted_title('encrypted string',
:conditions => ["any other condition can go here"])
Next step: To roll out the plugin as JRuby.
No comments:
Post a Comment