class

Amber::Support::MessageEncryptor

Inherits Reference < Object

Constructors

new(secret : String, cipher_algorithm : String = "aes-256-cbc", digest : Symbol = :sha256)
Source

Instance methods

decrypt(value : Bytes)
Source
encrypt(value, sign = false)
Source
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.

Source
verifier
Source
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.

Source