Sha256: 3743769b931ee89b632c3dd5e29eb1e216a2d08d52d919ba378e9fac465f20bd

Contents?: true

Size: 503 Bytes

Versions: 3

Compression:

Stored size: 503 Bytes

Contents

module SetecAstronomy
  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

3 entries across 3 versions & 1 rubygems

Version Path
setec_astronomy-0.2.1 lib/setec_astronomy/aes_crypt.rb
setec_astronomy-0.2.0 lib/setec_astronomy/aes_crypt.rb
setec_astronomy-0.1.0 lib/setec_astronomy/aes_crypt.rb