Sha256: 880fc1249e835551483a13f915073b33763b1ed4e812557c76f33578f023d817

Contents?: true

Size: 497 Bytes

Versions: 5

Compression:

Stored size: 497 Bytes

Contents

module Keepassx
  module AESCrypt
    def self.decrypt(encrypted_data, key, iv, cipher_type)
      aes = OpenSSL::Cipher::Cipher.new(cipher_type)
      aes.decrypt
      aes.key = key
      aes.iv = iv unless iv.nil?
      aes.update(encrypted_data) + aes.final
    end

    def self.encrypt(data, key, iv, cipher_type)
      aes = OpenSSL::Cipher::Cipher.new(cipher_type)
      aes.encrypt
      aes.key = key
      aes.iv = iv unless iv.nil?
      aes.update(data) + aes.final
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
ruby-keepassx-0.2.2beta1 lib/keepassx/aes_crypt.rb
ruby-keepassx-0.2.1 lib/keepassx/aes_crypt.rb
ruby-keepassx-0.2.0beta11 lib/keepassx/aes_crypt.rb
ruby-keepassx-0.2.0 lib/keepassx/aes_crypt.rb
keepassx-0.1.0 lib/keepassx/aes_crypt.rb