class Launch::Support::MessageEncryptor
Defined in:
launch/support/message_encryptor.crConstructors
Instance Method Summary
- #decrypt(value : Bytes)
- #encrypt(value, sign = false)
-
#encrypt_and_sign(value)
Encrypt and sign a message.
- #verifier : MessageVerifier
-
#verify_and_decrypt(value : Bytes) : Bytes
Verify and Decrypt a message.
Constructor Detail
def self.new(secret : String, cipher_algorithm : String = "aes-256-cbc", digest : Symbol = :sha256)
#
Instance Method Detail
def encrypt_and_sign(value)
#
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 : Bytes) : Bytes
#
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.