yaml_zlib_blowfish 1.0.0 → 2.0.210127

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
- SHA1:
3
- metadata.gz: b8ffc4b4f4f359a216517028ba9246b6b48f3d8e
4
- data.tar.gz: 3f4582fd29c022fe7746446da0b6fb6c4204ceeb
2
+ SHA256:
3
+ metadata.gz: 0c4fd11cdccda9c22dce4cb018034abc3e211ab8baf501f40b5a013908ca5ea2
4
+ data.tar.gz: 7bcb971acd454a6692bc79a90193ba001d5c8724dfea82a8dfcf344f8f51aa02
5
5
  SHA512:
6
- metadata.gz: 78f5e0641c0efd5e280cc298050c72742df839c0d20366e9eaf8f252ef1399166bcb5edab7ffbf87341e1016eaabb551d9f4caeaf882a708c65402f4ec95102e
7
- data.tar.gz: b7ce3d6d79f075dc854f8c6344c834ae36c55deebc81e6bf0aa07f4ab8999c94818a93455502645803a00b9efef7e6dc1a1f31aa2c1b237dd1178f3c97dcbf9b
6
+ metadata.gz: e5b116d431a511890f3b8cda1d1999968aa6ce5ce60da57930a0a26f2c6fca362cd015aaa9ff2e46a7000d9bb89fe223b6663460becdfaf8756e38de967d8e1b
7
+ data.tar.gz: 44d58c2a3963ce74a36f2fd7c3f54a01ba78b758f3eecb81add08dc9f6850c6b6d1b220b644cc96c18f8f3ed663a01687471d02604db514cc8d771ebf0399bf8
@@ -1,32 +1,35 @@
1
- = yaml_zlib_blowfish
1
+ # YamlZlibBlowfish
2
2
 
3
- {<img src="https://badge.fury.io/rb/yaml_zlib_blowfish.svg" alt="Gem Version" />}[http://badge.fury.io/rb/yaml_zlib_blowfish]
3
+ * [VERSION 2.0.210127](https://github.com/carlosjhr64/yaml_zlib_blowfish/releases)
4
+ * [github](https://github.com/carlosjhr64/yaml_zlib_blowfish)
5
+ * [rubygems](https://rubygems.org/gems/yaml_zlib_blowfish)
4
6
 
5
- == DESCRIPTION:
7
+ ## DESCRIPTION:
6
8
 
7
9
  Have you ever wanted to YAML dump, Zlib compress, and Blowfish encrypt your data structures?
8
10
  YOU HAVE!? Well...
9
11
 
10
- == SYNOPSIS:
12
+ ## SYNOPSIS:
11
13
 
12
- require 'yaml_zlib_blowfish'
13
- # ...
14
- yzb = YamlZlibBlowfish.new('passphrase')
15
- data = yzb.load('./path_to/file.yzb')
16
- # ...
17
- yzb.dump('./path_to/file.yzb', data)
14
+ ```ruby
15
+ require 'yaml_zlib_blowfish'
16
+ conf0 = [ 1, 2.0, 'Three', :four, {five: 'Cinco'}]
17
+ yzb = YamlZlibBlowfish.new('Secret PaSspHrase!')
18
+ yzb.dump('./tmp/dump.yzb', conf0)
19
+ conf1 = yzb.load('./tmp/dump.yzb')
20
+ conf1 == conf0 #=> true
21
+ # ...
22
+ ```
18
23
 
19
- Warning: this version(~1) is incompatible to prior alpha versions(~0).
24
+ ## INSTALL:
20
25
 
21
- == INSTALL:
26
+ $ gem install yaml_zlib_blowfish
22
27
 
23
- $ sudo gem install yaml_zlib_blowfish
24
-
25
- == LICENSE:
28
+ ## LICENSE:
26
29
 
27
30
  (The MIT License)
28
31
 
29
- Copyright (c) 2017 carlosjhr64
32
+ Copyright (c) 2021 CarlosJHR64
30
33
 
31
34
  Permission is hereby granted, free of charge, to any person obtaining
32
35
  a copy of this software and associated documentation files (the
@@ -5,20 +5,20 @@ require 'openssl'
5
5
  require 'digest/sha2'
6
6
 
7
7
  class YamlZlibBlowfish
8
- VERSION = '1.0.0'
8
+ VERSION = '2.0.210127'
9
9
 
10
10
  # yzb = YamlZlibBlowfish.new(passphrase)
11
11
  def initialize(passphrase)
12
- key = Digest::SHA256.digest(passphrase)
12
+ @key = Digest::SHA256.digest(passphrase)
13
13
  @cipher = OpenSSL::Cipher::BF.new(:CBC)
14
- @cipher.key_len = key.length
15
- @cipher.key = key
16
14
  end
17
15
 
18
16
  # encrypted_string = yzb.cipher(:encrypt, plain_string)
19
17
  # plain_string = yzb.cipher(:decrypt, encrypted_string)
20
18
  def cipher(mode, data)
21
- cipher = @cipher.send(mode)
19
+ cipher = @cipher.send(mode)
20
+ cipher.key_len = @key.length
21
+ cipher.key = @key
22
22
  cipher.update(data) << cipher.final
23
23
  end
24
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml_zlib_blowfish
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.210127
5
5
  platform: ruby
6
6
  authors:
7
7
  - carlosjhr64
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-29 00:00:00.000000000 Z
11
+ date: 2021-01-27 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?
@@ -16,19 +16,16 @@ description: |
16
16
  email: carlosjhr64@gmail.com
17
17
  executables: []
18
18
  extensions: []
19
- extra_rdoc_files:
20
- - README.rdoc
19
+ extra_rdoc_files: []
21
20
  files:
22
- - README.rdoc
21
+ - README.md
23
22
  - lib/yaml_zlib_blowfish.rb
24
23
  homepage: https://github.com/carlosjhr64/yaml_zlib_blowfish
25
24
  licenses:
26
25
  - MIT
27
26
  metadata: {}
28
- post_install_message:
29
- rdoc_options:
30
- - "--main"
31
- - README.rdoc
27
+ post_install_message:
28
+ rdoc_options: []
32
29
  require_paths:
33
30
  - lib
34
31
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -42,10 +39,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
39
  - !ruby/object:Gem::Version
43
40
  version: '0'
44
41
  requirements:
45
- - 'ruby: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]'
46
- rubyforge_project:
47
- rubygems_version: 2.6.11
48
- signing_key:
42
+ - 'ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]'
43
+ rubygems_version: 3.2.3
44
+ signing_key:
49
45
  specification_version: 4
50
46
  summary: Have you ever wanted to YAML dump, Zlib compress, and Blowfish encrypt your
51
47
  data structures? YOU HAVE!? Well...