argon2id 0.4.1-x86_64-linux → 0.5.0-x86_64-linux

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: 9318cf11fca52ec723694d3dde2cf1a53e4daea812043b4f6c61031ddb5df536
4
- data.tar.gz: eb70c488634387d09706bb0e6e23c454b197daa00926b0cd566b014218d16648
3
+ metadata.gz: 02a369375b9272f4203c2d5e21735f0ef3d850fbd11c1ea9baa8ba6e32a2abbd
4
+ data.tar.gz: e2e0e226b4942eceb84d1e6804ed576533d47a60c5fa43edd591b6962355a35b
5
5
  SHA512:
6
- metadata.gz: a1c03f0fae23330ee1f53b2f202c0e1aa8a3f6ee2d3c938104f54ec6645ccca94b91088815dec3af9d4e5afb010088fd12a161a444d9e64cfbd9a22a2e727572
7
- data.tar.gz: 8d316f7603b948ac099c00e1a375497b08dfe2794ad4ab24a3c4e7f592b6be2e1ae2e0fdf13f381dff397a2f2cc8c64d5c18f9e704837c664589fbb29196ac9d
6
+ metadata.gz: 4469dd8cbb34923f91576eb9dd06d585d7c29d6ccc3ba71e110b37c4857216c8472cb59d871280251d84fdb04920cad8090ec96a8026c4aa72d2526419ab4e93
7
+ data.tar.gz: 559ff774e5ac902e0050b140ab2d5a629399e8f28dca4b84fee7816f526d8b7e67be8007c234bea2fb1238300fbb82c586d761edd3800edc6d28d02473980400
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.5.0] - 2024-11-02
9
+
10
+ ### Removed
11
+
12
+ - No longer expose the `type` of an encoded hash as it must always be an
13
+ Argon2id hash
14
+
8
15
  ## [0.4.1] - 2024-11-02
9
16
 
10
17
  ### Changed
@@ -86,6 +93,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
86
93
  reference C implementation of Argon2, the password-hashing function that won
87
94
  the Password Hashing Competition.
88
95
 
96
+ [0.5.0]: https://github.com/mudge/argon2id/releases/tag/v0.5.0
89
97
  [0.4.1]: https://github.com/mudge/argon2id/releases/tag/v0.4.1
90
98
  [0.4.0]: https://github.com/mudge/argon2id/releases/tag/v0.4.0
91
99
  [0.3.0]: https://github.com/mudge/argon2id/releases/tag/v0.3.0
data/README.md CHANGED
@@ -5,7 +5,7 @@ Ruby bindings to [Argon2][], the password-hashing function that won the 2015
5
5
 
6
6
  [![Build Status](https://github.com/mudge/argon2id/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/mudge/argon2id/actions)
7
7
 
8
- **Current version:** 0.4.1
8
+ **Current version:** 0.5.0
9
9
  **Bundled Argon2 version:** libargon2.1 (20190702)
10
10
 
11
11
  ```ruby
@@ -135,6 +135,10 @@ password == "opensesame" #=> true
135
135
  password == "notopensesame" #=> false
136
136
  ```
137
137
 
138
+ > [!WARNING]
139
+ > `Argon2id::Password.new` does not support hashes generated from other Argon2
140
+ > variants such as Argon2i and Argon2d.
141
+
138
142
  For compatibility with [bcrypt-ruby][], `Argon2id::Password#==` is aliased to `Argon2id::Password.is_password?`:
139
143
 
140
144
  ```ruby
@@ -147,7 +151,6 @@ The various parts of the encoded hash can be retrieved:
147
151
 
148
152
  ```ruby
149
153
  password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
150
- password.type #=> "argon2id"
151
154
  password.version #=> 19
152
155
  password.m_cost #=> 256
153
156
  password.t_cost #=> 2
@@ -198,11 +201,11 @@ notes](https://github.com/mudge/argon2id/releases) for each version and can be
198
201
  checked with `sha256sum`, e.g.
199
202
 
200
203
  ```console
201
- $ gem fetch argon2id -v 0.4.0
202
- Fetching argon2id-0.4.0-arm64-darwin.gem
203
- Downloaded argon2id-0.4.0-arm64-darwin
204
- $ sha256sum argon2id-0.4.0-arm64-darwin.gem
205
- 2cecd6d5a1ecaf0a025e95714c0dee22dfc3d4585b649c57c06f432031b55a77 argon2id-0.4.0-arm64-darwin.gem
204
+ $ gem fetch argon2id -v 0.4.1
205
+ Fetching argon2id-0.4.1-arm64-darwin.gem
206
+ Downloaded argon2id-0.4.1-arm64-darwin
207
+ $ sha256sum argon2id-0.4.1-arm64-darwin.gem
208
+ c74c06c2c4ce70d6c3822f05d83bab4ea431dd16ec086c9c856da3c6e0d9bbe9 argon2id-0.4.1-arm64-darwin.gem
206
209
  ```
207
210
 
208
211
  [GPG](https://www.gnupg.org/) signatures are attached to each release (the
@@ -212,8 +215,8 @@ from a public keyserver, e.g. `gpg --keyserver keyserver.ubuntu.com --recv-key
212
215
  0x39AC3530070E0F75`):
213
216
 
214
217
  ```console
215
- $ gpg --verify argon2id-0.4.0-arm64-darwin.gem.sig argon2id-0.4.0-arm64-darwin.gem
216
- gpg: Signature made Sat 2 Nov 15:25:15 2024 GMT
218
+ $ gpg --verify argon2id-0.4.1-arm64-darwin.gem.sig argon2id-0.4.1-arm64-darwin.gem
219
+ gpg: Signature made Sat 2 Nov 20:50:54 2024 GMT
217
220
  gpg: using RSA key 702609D9C790F45B577D7BEC39AC3530070E0F75
218
221
  gpg: Good signature from "Paul Mucur <mudge@mudge.name>" [unknown]
219
222
  gpg: aka "Paul Mucur <paul@ghostcassette.com>" [unknown]
@@ -25,7 +25,6 @@ module Argon2id
25
25
  #
26
26
  # You can read various parameters out of a password hash:
27
27
  #
28
- # password.type #=> "argon2id"
29
28
  # password.version #=> 19
30
29
  # password.m_cost #=> 19456
31
30
  # password.t_cost #=> 2
@@ -36,7 +35,7 @@ module Argon2id
36
35
  PATTERN = %r{
37
36
  \A
38
37
  \$
39
- (argon2(?:id|i|d))
38
+ argon2id
40
39
  (?:\$v=(\d+))?
41
40
  \$m=(\d+)
42
41
  ,t=(\d+)
@@ -51,9 +50,6 @@ module Argon2id
51
50
  # The encoded password hash.
52
51
  attr_reader :encoded
53
52
 
54
- # The type of the hashing function.
55
- attr_reader :type
56
-
57
53
  # The version number of the hashing function.
58
54
  attr_reader :version
59
55
 
@@ -113,13 +109,12 @@ module Argon2id
113
109
  raise ArgumentError, "invalid hash" unless PATTERN =~ String(encoded)
114
110
 
115
111
  @encoded = $&
116
- @type = $1
117
- @version = Integer($2 || 0x10)
118
- @m_cost = Integer($3)
119
- @t_cost = Integer($4)
120
- @parallelism = Integer($5)
121
- @salt = $6.unpack1("m")
122
- @output = $7.unpack1("m")
112
+ @version = Integer($1 || 0x10)
113
+ @m_cost = Integer($2)
114
+ @t_cost = Integer($3)
115
+ @parallelism = Integer($4)
116
+ @salt = $5.unpack1("m")
117
+ @output = $6.unpack1("m")
123
118
  end
124
119
 
125
120
  # Return the encoded password hash.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Argon2id
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -98,6 +98,12 @@ class TestPassword < Minitest::Test
98
98
  end
99
99
  end
100
100
 
101
+ def test_raises_for_non_argon2id_hashes
102
+ assert_raises(ArgumentError) do
103
+ Argon2id::Password.new("$argon2i$v=19$m=256,t=2,p=1$c29tZXNhbHQ$iekCn0Y3spW+sCcFanM2xBT63UP2sghkUoHLIUpWRS8")
104
+ end
105
+ end
106
+
101
107
  def test_salt_supports_versionless_hashes
102
108
  password = Argon2id::Password.new("$argon2id$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
103
109
 
@@ -110,18 +116,6 @@ class TestPassword < Minitest::Test
110
116
  assert Argon2id::Password.new(password) == "password"
111
117
  end
112
118
 
113
- def test_extracting_type_from_hash
114
- password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
115
-
116
- assert_equal "argon2id", password.type
117
- end
118
-
119
- def test_extracting_type_from_argoni_hash
120
- password = Argon2id::Password.new("$argon2i$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
121
-
122
- assert_equal "argon2i", password.type
123
- end
124
-
125
119
  def test_extracting_version_from_hash
126
120
  password = Argon2id::Password.new("$argon2id$v=19$m=256,t=2,p=1$c29tZXNhbHQ$nf65EOgLrQMR/uIPnA4rEsF5h7TKyQwu9U1bMCHGi/4")
127
121
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: argon2id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Paul Mucur