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 +5 -5
- data/{README.rdoc → README.md} +19 -16
- data/lib/yaml_zlib_blowfish.rb +5 -5
- metadata +10 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0c4fd11cdccda9c22dce4cb018034abc3e211ab8baf501f40b5a013908ca5ea2
|
4
|
+
data.tar.gz: 7bcb971acd454a6692bc79a90193ba001d5c8724dfea82a8dfcf344f8f51aa02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5b116d431a511890f3b8cda1d1999968aa6ce5ce60da57930a0a26f2c6fca362cd015aaa9ff2e46a7000d9bb89fe223b6663460becdfaf8756e38de967d8e1b
|
7
|
+
data.tar.gz: 44d58c2a3963ce74a36f2fd7c3f54a01ba78b758f3eecb81add08dc9f6850c6b6d1b220b644cc96c18f8f3ed663a01687471d02604db514cc8d771ebf0399bf8
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,32 +1,35 @@
|
|
1
|
-
|
1
|
+
# YamlZlibBlowfish
|
2
2
|
|
3
|
-
|
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
|
-
|
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
|
-
|
12
|
+
## SYNOPSIS:
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
24
|
+
## INSTALL:
|
20
25
|
|
21
|
-
|
26
|
+
$ gem install yaml_zlib_blowfish
|
22
27
|
|
23
|
-
|
24
|
-
|
25
|
-
== LICENSE:
|
28
|
+
## LICENSE:
|
26
29
|
|
27
30
|
(The MIT License)
|
28
31
|
|
29
|
-
Copyright (c)
|
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
|
data/lib/yaml_zlib_blowfish.rb
CHANGED
@@ -5,20 +5,20 @@ require 'openssl'
|
|
5
5
|
require 'digest/sha2'
|
6
6
|
|
7
7
|
class YamlZlibBlowfish
|
8
|
-
VERSION = '
|
8
|
+
VERSION = '2.0.210127'
|
9
9
|
|
10
10
|
# yzb = YamlZlibBlowfish.new(passphrase)
|
11
11
|
def initialize(passphrase)
|
12
|
-
key
|
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
|
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:
|
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:
|
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.
|
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
|
46
|
-
|
47
|
-
|
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...
|