|
SecurePasswd_MGMT 2026.03.19
A modern, cross-platform password manager and two-factor authenticator (TOTP) designed with state-of-the-art security.
|
#include "key_derivation.h"#include <argon2.h>#include <sodium.h>#include <stdio.h>#include <string.h>Macros | |
| #define | MEMORY_COST (1 << 17) |
| #define | TIME_COST 3 |
| #define | PARALLELISM 1 |
Functions | |
| int | derive_key (const char *password, const uint8_t *salt, uint8_t *key) |
| Derives a key from a password and salt using Argon2id. | |
| int | load_or_generate_salt (const char *path, uint8_t *salt) |
| Loads the salt from the specified path, or generates a new one if it doesn't exist. | |
| int | save_salt (const char *path, const uint8_t *salt) |
| Saves the salt to the specified path. | |
| #define MEMORY_COST (1 << 17) |
| #define PARALLELISM 1 |
| #define TIME_COST 3 |
| int derive_key | ( | const char * | password, |
| const uint8_t * | salt, | ||
| uint8_t * | key ) |
Derives a key from a password and salt using Argon2id.
| password | The password to derive the key from. |
| salt | The salt to use for key derivation. |
| key | The buffer to store the derived key in. Must be KEY_LEN bytes. |
| int load_or_generate_salt | ( | const char * | path, |
| uint8_t * | salt ) |
Loads the salt from the specified path, or generates a new one if it doesn't exist.
| path | The path to the salt file. |
| salt | The buffer to store the loaded or generated salt in. Must be SALT_LEN bytes. |
| int save_salt | ( | const char * | path, |
| const uint8_t * | salt ) |
Saves the salt to the specified path.
| path | The path to the salt file. |
| salt | The salt to save. Must be SALT_LEN bytes. |