class Lite::Encryption::Schemes::NonDeterministic

Public Instance Methods

decrypt(value, opts = {}) click to toggle source
# File lib/lite/encryption/schemes/non_deterministic.rb, line 10
def decrypt(value, opts = {})
  cipher.decrypt_and_verify(value, **opts)
end
encrypt(value, opts = {}) click to toggle source
# File lib/lite/encryption/schemes/non_deterministic.rb, line 14
def encrypt(value, opts = {})
  cipher.encrypt_and_sign(value, **opts)
end

Private Instance Methods

cipher() click to toggle source
# File lib/lite/encryption/schemes/non_deterministic.rb, line 20
def cipher
  @cipher ||= ActiveSupport::MessageEncryptor.new(
    Lite::Encryption.configuration.encryption_key,
    cipher: Lite::Encryption::Key::CIPHER.name
  )
end