Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Node Argon2 | 1,710 | 273 | 310 | 10 days ago | 70 | November 04, 2023 | 18 | mit | JavaScript | |
Node.js bindings for Argon2 hashing algorithm | ||||||||||
Argon2id | 372 | 2 | 77 | 14 days ago | 2 | October 21, 2023 | 2 | mit | Go | |
Argon2id password hashing and verification for Go | ||||||||||
Noble Hashes | 372 | 537 | 11 days ago | 27 | August 23, 2023 | 3 | mit | JavaScript | ||
Audited & minimal JS implementation of hash functions, MACs and KDFs. | ||||||||||
Password4j | 292 | 4 | 2 months ago | 21 | September 14, 2023 | 5 | apache-2.0 | Java | ||
Java cryptographic library that supports Argon2, bcrypt, scrypt and PBKDF2 aimed to protect passwords in databases. Easy to use by design, highly customizable, secure and portable. All the implementations follow the standards and have been reviewed to perform better in the JVM. | ||||||||||
Phoenix Ecto Encryption Example | 266 | 8 days ago | 9 | Elixir | ||||||
🔐 A detailed example for how to encrypt data in an Elixir (Phoenix v1.7) App before inserting into a database using Ecto Types | ||||||||||
Argon2 Jvm | 260 | 47 | 51 | 2 years ago | 13 | October 02, 2021 | 3 | lgpl-3.0 | Java | |
Argon2 Binding for the JVM | ||||||||||
Argon2 Browser | 234 | 12 | 42 | 2 years ago | 31 | June 05, 2021 | 4 | mit | JavaScript | |
Argon2 library compiled for browser runtime | ||||||||||
Ruby Argon2 | 219 | 23 | 8 | 3 months ago | 24 | December 27, 2022 | mit | Ruby | ||
A Ruby gem offering bindings for Argon2 password hashing | ||||||||||
Argon2_elixir | 209 | 158 | 19 | 2 months ago | 48 | October 09, 2023 | 4 | apache-2.0 | Elixir | |
Elixir wrapper for the Argon2 password hashing algorithm | ||||||||||
Rust Argon2 | 202 | 461 | 94 | 2 months ago | 16 | August 11, 2023 | 5 | apache-2.0 | Rust | |
Rust library for hashing passwords using Argon2. |
The password hash Argon2, winner of PHC for mruby
add this to your build_config.rb
conf.gem mgem: 'mruby-argon2'
This packages libargon2 with mruby, so if you link mruby against your app you already have all symbols for argon2. The argon2.h file is inside the mruby/build/mrbgems/mruby-argon2/include
folder
out = Argon2.hash("a very long password")
if (Argon2.verify(out[:encoded], "a very long password"))
puts "entrance granted"
end
Argon2.hash has the following optional arguments:
salt: String # The salt to use, at least 8 characters, if you don't know what this is it's better left to the default value (default = 16 random bytes)
The secret
parameter, which is used for keyed hashing.
This allows a secret key to be input at hashing time (from some external
location) and be folded into the value of the hash. This means that even if
your salts and hashes are compromized, an attacker cannot brute-force to find
the password without the key.
The ad
parameter, which is used to fold any additional data into the hash
value. Functionally, this behaves almost exactly like the secret
or salt
parameters; the ad
parameter is folding into the value of the hash.
However, this parameter is used for different data. The salt
should be a
random string stored alongside your password. The secret
should be a random
key only usable at hashing time. The ad
is for any other data.
t_cost: Fixnum # Sets the number of iterations to N (default = 3)
m_cost: Fixnum # Sets the memory usage of N KiB (default = 2 << 12)
parallelism: Fixnum # Sets parallelism to N threads (default = 1)
hashlen: Fixnum # Sets hash output length to N bytes (default = 32)
type: Fixnum # You can choose between Argon2::I, Argon2::D or Argon2::ID (default = Argon2::I)
version: Fixnum # 0x10 or 0x13 (default = 0x13)
To find out more about them take a look at P-H-C/phc-winner-argon2
out = Argon2.hash("a very long password", secret: "a very secure secret")
if Argon2.verify(out[:encoded], "a very long password", secret: "a very secure secret")
puts "entrance granted"
end
Argon2.hash returns a ruby hash with the following fields
{
salt: # the salt
t_cost: # the number of itarations
m_cost: # the memory usage
parallelism: # the threads used
type: # the Argon2 type, as a Number
version: # the version number
hash: # the raw hash calculated
encoded: # the encoded String, suiteable for password Storage and verification
}
The default arguments can change over time, they are taken from the command like argon2 utility.