basic_ssl 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/basic_ssl.rb +2 -2
  2. metadata +1 -1
@@ -11,12 +11,12 @@ module BasicSSL
11
11
  aes_encrypt.key = aes_key = aes_encrypt.random_key
12
12
  crypt = aes_encrypt.update(string) << aes_encrypt.final
13
13
  encrypted_key = rsa_key(key).public_encrypt(aes_key)
14
- Base64.encode64(encrypted_key) + Base64.encode64(crypt)
14
+ [Base64.encode64(encrypted_key), Base64.encode64(crypt)].join("|")
15
15
  end
16
16
 
17
17
  ## Return the raw string after decryption & decoding
18
18
  def decrypt(key, string)
19
- encrypted_key, crypt = string.split("=").map{|a|Base64.decode64(a+'=')}
19
+ encrypted_key, crypt = string.split("|").map{|a| Base64.decode64(a) }
20
20
  aes_key = rsa_key(key).private_decrypt(encrypted_key)
21
21
  aes_decrypt = OpenSSL::Cipher::Cipher.new('AES-256-CBC').decrypt
22
22
  aes_decrypt.key = aes_key
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basic_ssl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke