Skip to content

Instantly share code, notes, and snippets.

@SergXIIIth
Created February 18, 2013 13:24
Show Gist options
  • Save SergXIIIth/4977359 to your computer and use it in GitHub Desktop.
Save SergXIIIth/4977359 to your computer and use it in GitHub Desktop.
Encryption Ruby On Rails
secret = Digest::SHA1.hexdigest("yourpass")
a = ActiveSupport::MessageEncryptor.new(secret)
b = a.encrypt("eh")
c = ActiveSupport::MessageEncryptor.new(secret)
c.decrypt(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment