secure_yaml 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,13 +9,13 @@ module SecureYaml
9
9
  def encrypt(secret_key, plain_data)
10
10
  cipher = create_cipher(secret_key)
11
11
  cipher.encrypt
12
- Base64.strict_encode64(cipher.update(plain_data) + cipher.final)
12
+ strip_newline_chars_from_base64(Base64.encode64(cipher.update(plain_data) + cipher.final))
13
13
  end
14
14
 
15
15
  def decrypt(secret_key, encrypted_data)
16
16
  cipher = create_cipher(secret_key)
17
17
  cipher.decrypt
18
- cipher.update(Base64.strict_decode64(encrypted_data)) + cipher.final
18
+ cipher.update(Base64.decode64(encrypted_data)) + cipher.final
19
19
  end
20
20
 
21
21
  private
@@ -27,6 +27,10 @@ module SecureYaml
27
27
  cipher
28
28
  end
29
29
 
30
+ def strip_newline_chars_from_base64(base64)
31
+ base64.gsub("\n", '')
32
+ end
33
+
30
34
  end
31
35
 
32
36
  end
@@ -1,5 +1,5 @@
1
1
  module SecureYaml
2
2
 
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secure_yaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: