SecurePasswd_MGMT 2026.03.19
A modern, cross-platform password manager and two-factor authenticator (TOTP) designed with state-of-the-art security.
Loading...
Searching...
No Matches
password_generator.h File Reference
#include <stdbool.h>
Include dependency graph for password_generator.h:
This graph shows which files directly or indirectly include this file:

Functions

char * generate_password (int len, bool upper, bool num, bool special)
 Generates a cryptographically secure random password.

Function Documentation

◆ generate_password()

char * generate_password ( int len,
bool upper,
bool num,
bool special )

Generates a cryptographically secure random password.

Uses libsodium's randombytes_buf for secure entropy and guarantees the inclusion of at least one character from each enabled pool (upper, num, special) using a secured Fisher-Yates shuffle.

Parameters
lenThe desired length of the password.
upperWhether to include uppercase letters.
numWhether to include numbers.
specialWhether to include special characters (!#$%^&*()).
Returns
A dynamically allocated string containing the password. The caller must free it.