Class | ActiveSupport::MessageEncryptor
In: | lib/active_support/message_encryptor.rb
Parent: | Object

MessageEncryptor is a simple way to encrypt values which get stored somewhere you don‘t trust.

The cipher text and initialization vector are base64 encoded and returned to you.

This can be used in situations similar to the MessageVerifier, but where you don‘t want users to be able to determine the value of the payload.

### Methods

decrypt decrypt_and_verify encrypt encrypt_and_sign new

### Classes and Modules

Class ActiveSupport::MessageEncryptor::InvalidMessage

### Constants

OpenSSLCipherError | = | OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError

### Public Class methods

new(secret, cipher = 'aes-256-cbc')

### Public Instance methods

decrypt(encrypted_message)
decrypt_and_verify(value)
encrypt(value)
encrypt_and_sign(value)

[Validate]