just-encrypt 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +21 -0
- data/README.md +52 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e35289244a30a59b4ee4445b1ceed17839c827b8a0f4b009ae0d6cb93222840
|
4
|
+
data.tar.gz: 0b67ccb69907ab655e67e5e48f34ba7ef187e190fad09e34eaac72596426a809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e0231c4b4c68a19769ac32e880a45d5d16b4ff7402a4233d779b85536838e45bbc86311c5e620a64506fbc0c2a3edd01db15161aff1993e50eb47d0ad26615
|
7
|
+
data.tar.gz: a61e0d8473a5a4baa693ecb68eff928a96c1b30b2672fe240b8f727aa771e493a46463af3c26c28059ebf8e29d5635fd1b7bf8b5db4b61b6a8ae69903ec464ab
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Jeremías Gutiérrez.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Just Encrypt
|
2
|
+
|
3
|
+
The simplest gem to encrypt and decrypt data, you only need to set a secret password to your credentials.
|
4
|
+
|
5
|
+
# Getting started
|
6
|
+
JustEncrypt works with Rails 5.2 onwards. Add the following line to your Gemfile:
|
7
|
+
```ruby
|
8
|
+
gem 'just-encrypt'
|
9
|
+
```
|
10
|
+
Then run `bundle install`
|
11
|
+
|
12
|
+
Next, you need to add a secret key into your credentials file, the key must be 32 bytes. You can generate one easily with OpenSSL:
|
13
|
+
```console
|
14
|
+
$ openssl rand -hex 32
|
15
|
+
```
|
16
|
+
|
17
|
+
Then edit your credentials:
|
18
|
+
```console
|
19
|
+
$ EDITOR=vim rails credentials:edit
|
20
|
+
```
|
21
|
+
|
22
|
+
And add the secret key generated with the next structure:
|
23
|
+
|
24
|
+
```console
|
25
|
+
just_encrypt:
|
26
|
+
secret: YOUR_SECRET_KEY
|
27
|
+
```
|
28
|
+
|
29
|
+
## Encrypt data
|
30
|
+
|
31
|
+
For encrypt data just do:
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
require 'just-encrypt'
|
35
|
+
|
36
|
+
JustEncrypt.encrypt('STRING_TO_ENCRYPT')
|
37
|
+
```
|
38
|
+
|
39
|
+
## Decrypt data
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'just-encrypt'
|
43
|
+
|
44
|
+
JustEncrypt.decrypt('STRING_TO_DECRYPT')
|
45
|
+
```
|
46
|
+
|
47
|
+
## Contributing
|
48
|
+
|
49
|
+
1. Fork it
|
50
|
+
2. Commit changes
|
51
|
+
3. Submit a Pull Request
|
52
|
+
4. :heart:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: just-encrypt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremías G.
|
@@ -16,9 +16,12 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- MIT-LICENSE
|
20
|
+
- README.md
|
19
21
|
- lib/just-encrypt.rb
|
20
22
|
homepage: https://github.com/jimmy-owoa/just-encrypt
|
21
|
-
licenses:
|
23
|
+
licenses:
|
24
|
+
- MIT
|
22
25
|
metadata: {}
|
23
26
|
post_install_message:
|
24
27
|
rdoc_options: []
|
@@ -28,7 +31,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
28
31
|
requirements:
|
29
32
|
- - ">="
|
30
33
|
- !ruby/object:Gem::Version
|
31
|
-
version:
|
34
|
+
version: 2.1.0
|
32
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
33
36
|
requirements:
|
34
37
|
- - ">="
|