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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15860ff6f0c444491002e98231bb32785c05d2f6f73be85e34ecb7a53ad43888
4
- data.tar.gz: 026be73917780e5bea3fc7178d404d2d4a2320378f94dc98c7dca0b180e40a83
3
+ metadata.gz: 41d031c1ae819dbf773416fffa04b9fe08abcfe8bd2012dab7a86d9e3046140c
4
+ data.tar.gz: 2fa33424258e616693caf343f2b7ca054276619bbf14ce7042a892f743c6f139
5
5
  SHA512:
6
- metadata.gz: 5cef3979e21483caaa9a860d2e6301c29dbc6c58a44be765da92970981695eb813d09a6c0b43dbd3a53fe3b30dc48dc212436be63dcbeac303d566064095e36b
7
- data.tar.gz: 9a7378720dcfb6a1a07687a42d957b3d4abfae349cbef0678a98e6b0f458d4726087c1ee69457624c13f8342ef67687232ccab25d6e2e339561e5603d98b9ea3
6
+ metadata.gz: bbc879f38246d0dcbc802beee879895f968d677ae895b6f0c7addebefa2ff7306befdd1406a02b24bbb2bec4f12bfb125f67c11c9280ba5e3e0517d67efb6360
7
+ data.tar.gz: 6d1b6474c2e9859b43ee6a44d7eb12aa5c6cb8657ce3b82abed09b13bd66b6912150823f12e67ca2409a99872b152a5527159843980b2668b39a41db445eb6ce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.0.1 (2024-12-29)
2
+
3
+ - Added support for Ruby 3.4
4
+
1
5
  ## 2.0.0 (2024-10-26)
2
6
 
3
7
  - Improved `attributes`, `attribute_names`, and `has_attribute?` when ciphertext attributes not loaded
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[7.2]
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[7.2]
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[7.2]
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[7.2]
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[7.2]
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[7.2]
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
@@ -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 = Base64.strict_encode64(ciphertext) if @encode
18
+ ciphertext = [ciphertext].pack("m0") if @encode
19
19
  ciphertext
20
20
  end
21
21
 
22
22
  def decrypt(ciphertext, **options)
23
- ciphertext = Base64.decode64(ciphertext) if @encode
23
+ ciphertext = ciphertext.unpack1("m") if @encode
24
24
  ciphertext = check_string(ciphertext)
25
25
 
26
26
  # ensure binary
@@ -1,3 +1,3 @@
1
1
  module Lockbox
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
data/lib/lockbox.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  # stdlib
2
- require "base64"
3
2
  require "openssl"
4
3
  require "securerandom"
5
4
  require "stringio"
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.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-27 00:00:00.000000000 Z
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.5.16
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: []