Sha256: e02ca930760366feb9e8f0a8011b2e349bb0849ae575234855d277918dc9f104

Contents?: true

Size: 338 Bytes

Versions: 2

Compression:

Stored size: 338 Bytes

Contents

# frozen_string_literal: true

class Cryptoform::EncryptionBackends::Lockbox < Cryptoform::EncryptionBackends::Backend
  def encrypt(json)
    lockbox.encrypt(json.to_json)
  end

  def decrypt(ciphertext)
    JSON.parse(lockbox.decrypt(ciphertext))
  end

  def lockbox
    ::Lockbox.new(key: @params[:key].call, encode: true)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cryptoform-0.4.0 lib/cryptoform/encryption_backends/lockbox.rb
cryptoform-0.2.0 lib/cryptoform/encryption_backends/lockbox.rb