devise_encryptable_aes 0.0.2 → 0.0.3
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 +4 -4
- data/README.md +63 -0
- metadata +46 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c9e5f608fcfe59dff0a29a1f5ce2bbb04c744b1ff9d382182e9e7457ce8a1c5
|
4
|
+
data.tar.gz: 39ae7fd53d95e91f6dbceb465d20212a381d719dfb94f937e6961e2d87edd5fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85d2cd0742d4d6f679d170f8ca8f1f96737cdb6f6b32eabf841cabfa2041a0e683bdb42110c60f87e551dcf417756ef907695f70ebebbf7d5110c73ed30156fc
|
7
|
+
data.tar.gz: 93ae280af08f5bf95554c7efa870a241fae8ea2496506481a2a0a77f67295f193f8bd2c48cc91d00a176de3ca4108464effbb7b6fb79e680c2bf3f7a08346720
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Devise Encryptable AES
|
2
|
+
|
3
|
+
Add AES encryption support for Devise
|
4
|
+
|
5
|
+
## Table of Contents
|
6
|
+
|
7
|
+
- [Getting started](#getting-started)
|
8
|
+
- [Configuration](#configuration)
|
9
|
+
- [Usage](#usage)
|
10
|
+
|
11
|
+
## Getting started
|
12
|
+
|
13
|
+
Add the following line to your Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'devise', '~> 4.9'
|
17
|
+
gem 'devise_encryptable_aes'
|
18
|
+
```
|
19
|
+
|
20
|
+
Then run `bundle install`
|
21
|
+
|
22
|
+
## Configuration
|
23
|
+
|
24
|
+
Add the `encryptable` module to your model:
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
class User < ActiveRecord::Base
|
28
|
+
devise :database_authenticatable, :encryptable
|
29
|
+
end
|
30
|
+
```
|
31
|
+
|
32
|
+
And add the `password_salt` field to the database through a migration:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
36
|
+
def change
|
37
|
+
add_column :users, :password_salt, :string
|
38
|
+
end
|
39
|
+
end
|
40
|
+
```
|
41
|
+
|
42
|
+
Enable the AES encryptor in <tt>config/initializers/devise.rb</tt>
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
# Uncomment the generated pepper
|
46
|
+
config.pepper = "long random string"
|
47
|
+
# Enable the AES encryptor
|
48
|
+
config.encryptor = :aes256
|
49
|
+
```
|
50
|
+
|
51
|
+
## Usage
|
52
|
+
|
53
|
+
Compare password
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
::Devise::Encryptable::Encryptors::Aes256.compare(encrypted_password, password, Devise.pepper)
|
57
|
+
```
|
58
|
+
|
59
|
+
Decrypt password
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
::Devise::Encryptable::Encryptors::Aes256.decrypt(encrypted_password, Devise.pepper)
|
63
|
+
```
|
metadata
CHANGED
@@ -1,21 +1,64 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_encryptable_aes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pham Tat Dat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
12
|
-
dependencies:
|
11
|
+
date: 2023-06-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: devise
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.9'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: aes
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.5.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.5.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: devise-encryptable
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.2.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.2.0
|
13
55
|
description: ''
|
14
56
|
email: tatdat97dhbkhn@gmail.com
|
15
57
|
executables: []
|
16
58
|
extensions: []
|
17
59
|
extra_rdoc_files: []
|
18
60
|
files:
|
61
|
+
- README.md
|
19
62
|
- lib/devise/encryptable/encryptors/aes256.rb
|
20
63
|
- lib/devise_encryptable_aes.rb
|
21
64
|
homepage: https://github.com/tatdat97dhbkhn/devise_encryptable_aes
|