#include <sodium.h>
Go to the source code of this file.
|
int | pbkdf2 (unsigned char(&output)[crypto_hash_sha256_BYTES], const unsigned char *key, size_t key_len, const unsigned char *salt, size_t salt_len, unsigned iterations) |
| Simple PBKDF2 implementation for hard to crack passwords. More...
|
|
◆ pbkdf2()
int pbkdf2 |
( |
unsigned char(&) |
output[crypto_hash_sha256_BYTES], |
|
|
const unsigned char * |
key, |
|
|
size_t |
key_len, |
|
|
const unsigned char * |
salt, |
|
|
size_t |
salt_len, |
|
|
unsigned |
iterations |
|
) |
| |
Simple PBKDF2 implementation for hard to crack passwords.
- Parameters
-
output | The output buffer for the digested hash |
key | The initial key we want to hash |
key_len | Length of the key in bytes |
salt | The salt we use to iteratively hash the key. |
salt_len | Length of the salt in bytes |
iterations | Number of salting iterations |
- Returns
- 0 on success, -1 on error