class

Lucky::MessageEncryptor

Inherits Reference < Object

Constructors

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

Instance methods

decrypt(value : Bytes) : Bytes
Source
encrypt(value) : Bytes
Source
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: https://en.wikipedia.org/wiki/Padding_oracle_attack.

Source
encrypt_and_sign(value : String) : String
Source
verifier
Source
verify_and_decrypt(value : String) : Bytes

Verify and Decrypt a message. We need to verify the message in order to avoid padding attacks. Reference: https://en.wikipedia.org/wiki/Padding_oracle_attack.

Source

Nested types