license updating
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
require 'openssl'
|
||||
require 'base64'
|
||||
require 'json'
|
||||
|
||||
class MyAesCrypt
|
||||
@cipher = ""
|
||||
@@ -26,6 +27,21 @@ class MyAesCrypt
|
||||
return cipher_key, cipher_iv
|
||||
end
|
||||
|
||||
def export_to_file(passphrase)
|
||||
file_path = "config/shops.json"
|
||||
aes_key, aes_iv = export_key(passphrase)
|
||||
tmpHash = {
|
||||
"lookup" => passphrase,
|
||||
"key" => aes_key,
|
||||
"iv" => aes_iv
|
||||
}
|
||||
|
||||
File.open(file_path, "w") { |io|
|
||||
io.write(tmpHash.to_json)
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
def encrypt(data)
|
||||
cipher.encrypt
|
||||
|
||||
Reference in New Issue
Block a user