Over a million developers have joined DZone.

Quick Two Encryption With ActiveSupport & 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)

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}