info_vault 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/info_vault.rb +3 -3
- data/lib/info_vault/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4415b393e0e40be6c8acf6cba1389fd52865da68
|
4
|
+
data.tar.gz: 740dd054de0c785b06e6919f4e97cb02f6241c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cf306e5ce50eacc302d130363ab0a512f21c492ccb198d6f31d884760ffc4c44174aad1a8a97146410fab2564a92a588bfb84c572d923d8a143df3b8763c02d
|
7
|
+
data.tar.gz: 14f30778d2bd4fc4a669d7947edbf6f4ecdac6b69a05a7ce8cf9781e3221686e4107961c891b83435d90baacda9081ea6233330aefeffabc16db61fdc489cdbd
|
data/lib/info_vault.rb
CHANGED
@@ -8,12 +8,12 @@ module InfoVault
|
|
8
8
|
# decrypt("account","password")
|
9
9
|
def decrypt(key,pass_phrase,file="")
|
10
10
|
file = File.open(File.expand_path(File.join('config','protected_info.yaml')),'r') if file.empty?
|
11
|
-
|
11
|
+
data = YAML::load(file)
|
12
12
|
decrypter = OpenSSL::Cipher.new 'AES-128-CBC'
|
13
13
|
decrypter.decrypt
|
14
|
-
decrypter.pkcs5_keyivgen pass_phrase
|
14
|
+
decrypter.pkcs5_keyivgen pass_phrase,data[key.to_sym][:salt]
|
15
15
|
|
16
|
-
plain = decrypter.update
|
16
|
+
plain = decrypter.update data[key.to_sym][:encrypted]
|
17
17
|
plain << decrypter.final
|
18
18
|
end
|
19
19
|
end
|
data/lib/info_vault/version.rb
CHANGED