lib/eco/data/crypto/encryption.rb in eco-helpers-1.5.1 vs lib/eco/data/crypto/encryption.rb in eco-helpers-1.5.2

- old
+ new

@@ -5,10 +5,11 @@ require_relative '../../cli/scripting' # see some ramblings here: http://distributed-frostbite.blogspot.com/2010/06/file-encryption-in-ruby-with-openssl.html + def run! # this will run only if called from command line (not when require'd nor load'd) include Eco::CLI::Scripting include Eco::Data::Crypto # script arguments keygen = get_arg("-keygen") @@ -143,9 +144,11 @@ str_c += cipher.update(str.slice!(0, block_bits)) end str_c += cipher.final return str_c #EncryptedData.new({content: str_c, key: key, iv: iv}) + + end def aes256_decrypt(data, key: , iv: , block_octets: BLOCK_OCTETS) block_bits = block_bits * 8 #validation = encrypted_data && encrypted_data.key && encrypted_data.iv # return nil unless validation