-
-
Notifications
You must be signed in to change notification settings - Fork 3
libsodium.Password.GenerateHash
##Method Signature
Function GenerateHash(HashAlgorithm As Int32 = libsodium.Password.ALG_ARGON2, Limits As libsodium.ResourceLimits = libsodium.ResourceLimits.Interactive) As MemoryBlock
##Parameters
Name | Type | Comment |
---|---|---|
HashAlgorithm | Int32 | Optional. Either ALG_ARGON2 (default) or ALG_SCRYPT . |
Limits | ResourceLimits | Optional. A member of the ResourceLimits enumeration. |
##Return value A fixed-length hash of the password.
##Remarks This method computes a computationally-intensive salted hash (either Argon2 or scrypt) of the password. The resulting hash value is suitable for storage (e.g. in a database).
The salt is selected at random and is included as part of the output. As such, calling this method with the same password will produce different output each time. Use the VerifyHash method to validate a password.
You can fine-tune how resource-intensive the hash operation is by changing the Limits
parameter. The default is Interactive
, which is the least intensive (i.e. suitable for interactive desktop programs.) Beware that this method may fail if the Limits
are so intensive that the system can't or won't satisfy them.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2016-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.
- libsodium module
- FAQ
-
Examples
- Secure memory
- Password hashing
- Generic hashing
- Encrypting streams or files
- PKI
- Encryption
- Digital signatures
- SKI
- Encryption
- Message authentication