class ActionController::MessageEncryptor
- ActionController::MessageEncryptor
- Reference
- Object
Defined in:
action-controller/session/message_encryptor.crConstructors
Instance Method Summary
- #decrypt(value : Bytes)
- #encrypt(value)
-
#encrypt_and_sign(value : Slice(UInt8)) : String
Encrypt and sign a message.
- #encrypt_and_sign(value : String) : String
- #extract(value)
- #prepare(value)
- #verifier : MessageVerifier
-
#verify_and_decrypt(value : String) : String
Verify and Decrypt a message.
Constructor Detail
def self.new(secret : String, cipher_algorithm : String = "aes-256-cbc", digest : OpenSSL::Algorithm = :sha1)
#
Instance Method Detail
def encrypt_and_sign(value : Slice(UInt8)) : String
#
Encrypt and sign a message. We need to sign the message in order to avoid padding attacks. Reference: http://www.limited-entropy.com/padding-oracle-attacks.
def verify_and_decrypt(value : String) : String
#
Verify and Decrypt a message. We need to verify the message in order to avoid padding attacks. Reference: http://www.limited-entropy.com/padding-oracle-attacks.