Skip to content

Instantly share code, notes, and snippets.

@thoughtbot
Created August 4, 2009 22:27
Show Gist options
  • Select an option

  • Save thoughtbot/162321 to your computer and use it in GitHub Desktop.

Select an option

Save thoughtbot/162321 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
encrypt_with_public_key :secret,
:key_pair => File.join(RAILS_ROOT,'config','keypair.pem'),
end
user.secret.decrypt 'password'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment