method

encrypt

Importance_2
v7.0.0 - Show latest stable - 0 notes - Class: Encryptor
encrypt(clear_text, key_provider: default_key_provider, cipher_options: {}) public

Encrypts clean_text and returns the encrypted result

Internally, it will:

  1. Create a new +ActiveRecord::Encryption::Message+

  2. Compress and encrypt clean_text as the message payload

  3. Serialize it with +ActiveRecord::Encryption.message_serializer+ (+ActiveRecord::Encryption::SafeMarshal+ by default)

  4. Encode the result with Base 64

Options

:key_provider

Key provider to use for the encryption operation. It will default to +ActiveRecord::Encryption.key_provider+ when not provided

:cipher_options

Cipher-specific options that will be passed to the Cipher configured in +ActiveRecord::Encryption.cipher+

Show source
Register or log in to add new notes.