Sha256: db502d8d40569b172c990307b87e068a5d145b922ba8d97c9acaf804a6cea594

Contents?: true

Size: 449 Bytes

Versions: 7

Compression:

Stored size: 449 Bytes

Contents

class Lockbox
  class Encryptor
    def self.encrypt(options)
      box(options).encrypt(options[:value])
    end

    def self.decrypt(options)
      box(options).decrypt(options[:value])
    end

    def self.box(options)
      options = options.slice(:key, :encryption_key, :decryption_key, :algorithm, :previous_versions)
      options[:algorithm] = "aes-gcm" if options[:algorithm] == "aes-256-gcm"
      Lockbox.new(options)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lockbox-0.2.5 lib/lockbox/encryptor.rb
lockbox-0.2.4 lib/lockbox/encryptor.rb
lockbox-0.2.3 lib/lockbox/encryptor.rb
lockbox-0.2.2 lib/lockbox/encryptor.rb
lockbox-0.2.1 lib/lockbox/encryptor.rb
lockbox-0.2.0 lib/lockbox/encryptor.rb
lockbox-0.1.1 lib/lockbox/encryptor.rb