enigma_decrypter 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4260c4c67da5e299cd5a3f5aaa7b64155548d8ae
4
- data.tar.gz: 7b79602c8d004c47f50f9bc127c99674f9ca8ca9
3
+ metadata.gz: 77f3c871116600322b869c36190215db89698b10
4
+ data.tar.gz: 0d50c530c3e67e4b210a3574a80b390424f98d78
5
5
  SHA512:
6
- metadata.gz: a531b4bd3df7b6ff88042c6def7a5451890a4cf586c42b82ed7fe9c299b36f5abae85e34cb997d7212827e3616460821900d13a0d957c759b2e91a533f398519
7
- data.tar.gz: 54cc1a7db3cd4afef49149ed84e2dc00c96cfd85bbb8cfb6be369b1d6a65acae4c5aae835e71b8ee00fd5f9f681f6af58a8b6f05914d7151fb6ef6f5f4452512
6
+ metadata.gz: 22a178d671484b9aabdef80d122d7eddbdeb034db5d5023a09fe37ecd11e4c77c0ec83c9674e0d61acff36d09ac4c87f631f4d6e144c6991548c2a43a899dc05
7
+ data.tar.gz: b760a8b542783b531e8834cce08d12cb8461860d81c9ab272c5f9991fe2d5f732ffb5b5bab5a733c27d3ba057c5ada09c6989c0630129d815462abeeb8f19d92
@@ -3,8 +3,9 @@ require 'openssl'
3
3
  require 'base64'
4
4
 
5
5
  module EnigmaDecrypter
6
- def self.decrypt(encrypted_key, private_key)
7
- return nil if encrypted_key.to_s.empty? || private_key.to_s.empty?
6
+ def self.decrypt(encrypted_key, private_key_path)
7
+ return nil if encrypted_key.to_s.empty? || private_key_path.to_s.empty?
8
+ private_key = File.read(private_key_path)
8
9
  rsa_private_key = OpenSSL::PKey::RSA.new(private_key)
9
10
  rsa_private_key.private_decrypt(Base64.decode64(encrypted_key))
10
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnigmaDecrypter
4
- VERSION = '0.1.0'.freeze
4
+ VERSION = '0.1.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enigma_decrypter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caio Almeida, Vitor Vidotto