class Launch::Support::MessageEncryptor

Defined in:

launch/support/message_encryptor.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

blank? blank?, present? present?

Constructor Detail

def self.new(secret : String, cipher_algorithm : String = "aes-256-cbc", digest : Symbol = :sha256) #

[View source]

Instance Method Detail

def decrypt(value : Bytes) #

[View source]
def encrypt(value, sign = false) #

[View source]
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.


[View source]
def verifier : MessageVerifier #

[View source]
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.


[View source]