lockbox 2.0.0 → 2.0.1
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/CHANGELOG.md +4 -0
- data/README.md +6 -6
- data/lib/lockbox/encryptor.rb +2 -2
- data/lib/lockbox/version.rb +1 -1
- data/lib/lockbox.rb +0 -1
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41d031c1ae819dbf773416fffa04b9fe08abcfe8bd2012dab7a86d9e3046140c
|
4
|
+
data.tar.gz: 2fa33424258e616693caf343f2b7ca054276619bbf14ce7042a892f743c6f139
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbc879f38246d0dcbc802beee879895f968d677ae895b6f0c7addebefa2ff7306befdd1406a02b24bbb2bec4f12bfb125f67c11c9280ba5e3e0517d67efb6360
|
7
|
+
data.tar.gz: 6d1b6474c2e9859b43ee6a44d7eb12aa5c6cb8657ce3b82abed09b13bd66b6912150823f12e67ca2409a99872b152a5527159843980b2668b39a41db445eb6ce
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -72,7 +72,7 @@ Then follow the instructions below for the data you want to encrypt.
|
|
72
72
|
Create a migration with:
|
73
73
|
|
74
74
|
```ruby
|
75
|
-
class AddEmailCiphertextToUsers < ActiveRecord::Migration[
|
75
|
+
class AddEmailCiphertextToUsers < ActiveRecord::Migration[8.0]
|
76
76
|
def change
|
77
77
|
add_column :users, :email_ciphertext, :text
|
78
78
|
end
|
@@ -251,7 +251,7 @@ User.decrypt_email_ciphertext(user.email_ciphertext)
|
|
251
251
|
Create a migration with:
|
252
252
|
|
253
253
|
```ruby
|
254
|
-
class AddBodyCiphertextToRichTexts < ActiveRecord::Migration[
|
254
|
+
class AddBodyCiphertextToRichTexts < ActiveRecord::Migration[8.0]
|
255
255
|
def change
|
256
256
|
add_column :action_text_rich_texts, :body_ciphertext, :text
|
257
257
|
end
|
@@ -382,7 +382,7 @@ Encryption is applied to all versions after processing.
|
|
382
382
|
You can mount the uploader [as normal](https://github.com/carrierwaveuploader/carrierwave#activerecord). With Active Record, this involves creating a migration:
|
383
383
|
|
384
384
|
```ruby
|
385
|
-
class AddLicenseToUsers < ActiveRecord::Migration[
|
385
|
+
class AddLicenseToUsers < ActiveRecord::Migration[8.0]
|
386
386
|
def change
|
387
387
|
add_column :users, :license, :string
|
388
388
|
end
|
@@ -910,7 +910,7 @@ end
|
|
910
910
|
You can use `binary` columns for the ciphertext instead of `text` columns.
|
911
911
|
|
912
912
|
```ruby
|
913
|
-
class AddEmailCiphertextToUsers < ActiveRecord::Migration[
|
913
|
+
class AddEmailCiphertextToUsers < ActiveRecord::Migration[8.0]
|
914
914
|
def change
|
915
915
|
add_column :users, :email_ciphertext, :binary
|
916
916
|
end
|
@@ -961,7 +961,7 @@ end
|
|
961
961
|
Create a migration with:
|
962
962
|
|
963
963
|
```ruby
|
964
|
-
class MigrateToLockbox < ActiveRecord::Migration[
|
964
|
+
class MigrateToLockbox < ActiveRecord::Migration[8.0]
|
965
965
|
def change
|
966
966
|
add_column :users, :name_ciphertext, :text
|
967
967
|
add_column :users, :email_ciphertext, :text
|
@@ -994,7 +994,7 @@ end
|
|
994
994
|
Then remove the previous gem from your Gemfile and drop its columns.
|
995
995
|
|
996
996
|
```ruby
|
997
|
-
class RemovePreviousEncryptedColumns < ActiveRecord::Migration[
|
997
|
+
class RemovePreviousEncryptedColumns < ActiveRecord::Migration[8.0]
|
998
998
|
def change
|
999
999
|
remove_column :users, :encrypted_name, :text
|
1000
1000
|
remove_column :users, :encrypted_name_iv, :text
|
data/lib/lockbox/encryptor.rb
CHANGED
@@ -15,12 +15,12 @@ module Lockbox
|
|
15
15
|
def encrypt(message, **options)
|
16
16
|
message = check_string(message)
|
17
17
|
ciphertext = @boxes.first.encrypt(message, **options)
|
18
|
-
ciphertext =
|
18
|
+
ciphertext = [ciphertext].pack("m0") if @encode
|
19
19
|
ciphertext
|
20
20
|
end
|
21
21
|
|
22
22
|
def decrypt(ciphertext, **options)
|
23
|
-
ciphertext =
|
23
|
+
ciphertext = ciphertext.unpack1("m") if @encode
|
24
24
|
ciphertext = check_string(ciphertext)
|
25
25
|
|
26
26
|
# ensure binary
|
data/lib/lockbox/version.rb
CHANGED
data/lib/lockbox.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lockbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2024-
|
10
|
+
date: 2024-12-29 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
|
-
description:
|
14
12
|
email: andrew@ankane.org
|
15
13
|
executables: []
|
16
14
|
extensions: []
|
@@ -43,7 +41,6 @@ homepage: https://github.com/ankane/lockbox
|
|
43
41
|
licenses:
|
44
42
|
- MIT
|
45
43
|
metadata: {}
|
46
|
-
post_install_message:
|
47
44
|
rdoc_options: []
|
48
45
|
require_paths:
|
49
46
|
- lib
|
@@ -58,8 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
55
|
- !ruby/object:Gem::Version
|
59
56
|
version: '0'
|
60
57
|
requirements: []
|
61
|
-
rubygems_version: 3.
|
62
|
-
signing_key:
|
58
|
+
rubygems_version: 3.6.2
|
63
59
|
specification_version: 4
|
64
60
|
summary: Modern encryption for Ruby and Rails
|
65
61
|
test_files: []
|