yaml_zlib_blowfish 2.0.210127 → 2.0.250921

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c4fd11cdccda9c22dce4cb018034abc3e211ab8baf501f40b5a013908ca5ea2
4
- data.tar.gz: 7bcb971acd454a6692bc79a90193ba001d5c8724dfea82a8dfcf344f8f51aa02
3
+ metadata.gz: 89f1e4bf8e5417fdaba2c3c2f463523ccdeff02fa03afd053f60ca2f642c0efd
4
+ data.tar.gz: b527958974afda784d6ade0a972aaa3af130177e6115bce04d31424d5824b125
5
5
  SHA512:
6
- metadata.gz: e5b116d431a511890f3b8cda1d1999968aa6ce5ce60da57930a0a26f2c6fca362cd015aaa9ff2e46a7000d9bb89fe223b6663460becdfaf8756e38de967d8e1b
7
- data.tar.gz: 44d58c2a3963ce74a36f2fd7c3f54a01ba78b758f3eecb81add08dc9f6850c6b6d1b220b644cc96c18f8f3ed663a01687471d02604db514cc8d771ebf0399bf8
6
+ metadata.gz: fada397306c92ada977008c16113610d18c5328800773051fdc97d69945e8db44b57544c0ab494ca5f521cd4bc42d1093cc2ef99d7b543c982e160cd59be510f
7
+ data.tar.gz: b2b6e96c52fd2c17f0c9fe6faa4d2890ffbc227cf94c6b5465ace4ad3308e9ccca56fb40420777cf6f2e0d1ae3f6b5e450fe5ed9931d119df9a0089325a09866
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # YamlZlibBlowfish
2
2
 
3
- * [VERSION 2.0.210127](https://github.com/carlosjhr64/yaml_zlib_blowfish/releases)
3
+ * [VERSION 2.0.250921](https://github.com/carlosjhr64/yaml_zlib_blowfish/releases)
4
4
  * [github](https://github.com/carlosjhr64/yaml_zlib_blowfish)
5
5
  * [rubygems](https://rubygems.org/gems/yaml_zlib_blowfish)
6
6
 
@@ -9,8 +9,9 @@
9
9
  Have you ever wanted to YAML dump, Zlib compress, and Blowfish encrypt your data structures?
10
10
  YOU HAVE!? Well...
11
11
 
12
- ## SYNOPSIS:
12
+ BUT BLOWFISH IS DEPRECATED! .·°՞(¯□¯)՞°·.
13
13
 
14
+ ## SYNOPSIS:
14
15
  ```ruby
15
16
  require 'yaml_zlib_blowfish'
16
17
  conf0 = [ 1, 2.0, 'Three', :four, {five: 'Cinco'}]
@@ -20,7 +21,6 @@ conf1 = yzb.load('./tmp/dump.yzb')
20
21
  conf1 == conf0 #=> true
21
22
  # ...
22
23
  ```
23
-
24
24
  ## INSTALL:
25
25
 
26
26
  $ gem install yaml_zlib_blowfish
@@ -29,7 +29,7 @@ conf1 == conf0 #=> true
29
29
 
30
30
  (The MIT License)
31
31
 
32
- Copyright (c) 2021 CarlosJHR64
32
+ Copyright (c) 2025 CarlosJHR64
33
33
 
34
34
  Permission is hereby granted, free of charge, to any person obtaining
35
35
  a copy of this software and associated documentation files (the
@@ -1,25 +1,27 @@
1
1
  # Standard Libraries
2
2
  require 'yaml'
3
3
  require 'zlib'
4
- require 'openssl'
5
4
  require 'digest/sha2'
5
+ require 'openssl'
6
+ OpenSSL::Provider.load('legacy')
6
7
 
7
8
  class YamlZlibBlowfish
8
- VERSION = '2.0.210127'
9
+ VERSION = '2.0.250921'
9
10
 
10
11
  # yzb = YamlZlibBlowfish.new(passphrase)
11
12
  def initialize(passphrase)
12
- @key = Digest::SHA256.digest(passphrase)
13
- @cipher = OpenSSL::Cipher::BF.new(:CBC)
13
+ # Blowfish takes a variable length key from 32 to 448 bits.
14
+ # Here we create a 256 bit key based on the pass-phrase:
15
+ @key = Digest::SHA256.digest(passphrase)
14
16
  end
15
17
 
16
18
  # encrypted_string = yzb.cipher(:encrypt, plain_string)
17
19
  # plain_string = yzb.cipher(:decrypt, encrypted_string)
18
20
  def cipher(mode, data)
19
- cipher = @cipher.send(mode)
21
+ cipher = OpenSSL::Cipher::BF.new(:CBC).send(mode)
20
22
  cipher.key_len = @key.length
21
23
  cipher.key = @key
22
- cipher.update(data) << cipher.final
24
+ cipher.update(data) + cipher.final
23
25
  end
24
26
 
25
27
  # plain_structure = yzb.decrypt(encrypted_compressed_dump)
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml_zlib_blowfish
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.210127
4
+ version: 2.0.250921
5
5
  platform: ruby
6
6
  authors:
7
- - carlosjhr64
7
+ - CarlosJHR64
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-27 00:00:00.000000000 Z
11
+ date: 2025-09-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Have you ever wanted to YAML dump, Zlib compress, and Blowfish encrypt your data structures?
15
15
  YOU HAVE!? Well...
16
+
17
+ BUT BLOWFISH IS DEPRECATED! .·°՞(¯□¯)՞°·.
16
18
  email: carlosjhr64@gmail.com
17
19
  executables: []
18
20
  extensions: []
@@ -32,15 +34,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
32
34
  requirements:
33
35
  - - ">="
34
36
  - !ruby/object:Gem::Version
35
- version: '0'
37
+ version: '3.3'
36
38
  required_rubygems_version: !ruby/object:Gem::Requirement
37
39
  requirements:
38
40
  - - ">="
39
41
  - !ruby/object:Gem::Version
40
42
  version: '0'
41
- requirements:
42
- - 'ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]'
43
- rubygems_version: 3.2.3
43
+ requirements: []
44
+ rubygems_version: 3.5.3
44
45
  signing_key:
45
46
  specification_version: 4
46
47
  summary: Have you ever wanted to YAML dump, Zlib compress, and Blowfish encrypt your