Last active
August 29, 2015 14:06
-
-
Save mattetti/97adf09df58b969943d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crypt_secret = key_generator.generate_key("signed encrypted cookie") | |
encryptor = ActiveSupport::MessageEncryptor.new(secret, crypt_secret) | |
encrypted_message = encryptor.encrypt_and_sign({msg: "hello world"}) | |
encryptor.decrypt_and_verify(encrypted_message) | |
# => {:msg => "hello world"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment