The "argon2" Module (v4)
This module depends on a third-party library (Argon2) and must be manually enabled at compile time.
Once you have installed the dependency you can enable this module using the following command:
./configure --enable-extras argon2
Description
This module allows other modules to generate Argon2 hashes.
Configuration
To load this module use the following <module>
tag:
<module name="argon2">
<argon2>
The <argon2>
tag defines the defaults for the Argon2 algorithms. This tag can only be defined once.
Name | Type | Default Value | Description |
---|---|---|---|
memory | Number | 131072 | The memory hardness in kibibytes of the Argon2 algorithms. |
iterations | Number | 3 | The time hardness of the Argon2 algorithms. |
threads | Number | 1 | The number of threads that generating an Argon2 hash can spawn. |
length | Number | 32 | The length of the output in bytes. |
saltlength | Number | 16 | The length of the salt in bytes. |
Example Usage
<argon2 memory="128MB"
iterations="3"
threads="1"
length="32"
saltlength="16">
<argon2d>
The <argon2d>
tag defines the settings for the Argon2d algorithm. This tag can only be defined once.
Name | Type | Default Value | Description |
---|---|---|---|
memory | Number | See <argon2:memory> | The memory hardness in kibibytes of the Argon2d algorithm. |
iterations | Number | See <argon2:iterations> | The time hardness of the Argon2d algorithm. |
threads | Number | See <argon2:threads> | The number of threads that generating an Argon2d hash can spawn. |
length | Number | See <argon2:length> | The length of the output in bytes. |
saltlength | Number | See <argon2:saltlength> | The length of the salt in bytes. |
Example Usage
<argon2d memory="128MB"
iterations="3"
threads="1"
length="32"
saltlength="16">
<argon2i>
The <argon2i>
tag defines the settings for the Argon2i algorithm. This tag can only be defined once.
Name | Type | Default Value | Description |
---|---|---|---|
memory | Number | See <argon2:memory> | The memory hardness in kibibytes of the Argon2i algorithm. |
iterations | Number | See <argon2:iterations> | The time hardness of the Argon2i algorithm. |
threads | Number | See <argon2:threads> | The number of threads that generating an Argon2i hash can spawn. |
length | Number | See <argon2:length> | The length of the output in bytes. |
saltlength | Number | See <argon2:saltlength> | The length of the salt in bytes. |
Example Usage
<argon2i memory="128MB"
iterations="3"
threads="1"
length="32"
saltlength="16">
<argon2id>
The <argon2id>
tag defines the settings for the Argon2id algorithm. This tag can only be defined once.
Name | Type | Default Value | Description |
---|---|---|---|
memory | Number | See <argon2:memory> | The memory hardness in kibibytes of the Argon2id algorithm. |
iterations | Number | See <argon2:iterations> | The time hardness of the Argon2id algorithm. |
threads | Number | See <argon2:threads> | The number of threads that generating an Argon2id hash can spawn. |
length | Number | See <argon2:length> | The length of the output in bytes. |
saltlength | Number | See <argon2:saltlength> | The length of the salt in bytes. |
Example Usage
<argon2id memory="128MB"
iterations="3"
threads="1"
length="32"
saltlength="16">
Special Notes
Argon2 is a memory-hard hashing function. If you are using an older system with low memory you should make sure to configure it appropriately for your system. Alternately, you should consider using another hashing function such as bcrypt or HMAC-SHA256.