1. Overview
The PasswordGenerator.hpp file is a Password generator public interface in BastionGuard.
Declares configurable password generation with selectable uppercase, lowercase, numeric, and symbol character classes.
The documentation below is generated from the supplied source and covers its API surface, runtime responsibilities, data flow, filesystem or command interactions, concurrency model, and security considerations.
2. Source Inventory
- Original path:
password_manager/PasswordGenerator.hpp - Language: C++
- Source type:
.hpp - Line count: 34
- SHA-256:
7c40da5a02fdd63150d89720941d754c985192e8b4f1bd7f07c7b00583ec27c5
3. Dependencies
The file declares the following compile-time dependencies:
C/C++ Runtime
string
4. Types and Public Contract
The file declares or implements the following principal types:
- Class:
PasswordGenerator
Declared Public Members
static std::string generate(std::size_t length = 20, bool useUpper = true, bool useLower = true, bool useDigits = true, bool useSymbols = true);
5. API and Method Inventory
The file contains no out-of-line function implementation. Its behavior is supplied by declarations, inline functions, or associated implementation files.
6. Functional Architecture
Generation Algorithm
- Omits visually ambiguous characters such as uppercase
I/O, lowercasel/o, and digits0/1. - Adds one character from each enabled class before filling the remaining positions.
- Automatically increases the requested length when it is smaller than the number of enabled classes.
- Shuffles the final string so mandatory class characters do not remain in predictable positions.
Randomness
- Uses thread-local
std::random_deviceto seedstd::mt19937. - Throws when no character class is enabled or when an empty character set reaches the internal selector.
7. Operational Flow
- Build the combined character set from enabled categories.
- Insert at least one character from every enabled category.
- Fill the remaining requested length from the combined set.
- Shuffle the completed password before returning it.
8. Filesystem and External Command Surface
No hard-coded absolute filesystem path is declared directly in this file.
Commands or Security Primitives Referenced
sh
9. Concurrency and Lifecycle
The file contains no explicit worker-thread or callback-lifetime mechanism.
10. Security Considerations
- Password metadata and encrypted secrets are separated, reducing accidental exposure through the index file.
- Cleartext passwords exist in process memory while the vault is unlocked and during import/export workflows.
- CSV import and export files are unencrypted and must be handled as sensitive data.
- Background callbacks must not outlive their owning GTK objects.
11. Implementation Considerations
- This header defines the public or private class contract; behavior is implemented by the matching
.cppfile unless marked inline.
12. Licensing and Branding
The source is distributed under the GNU General Public License version 3.
The source header identifies BastionGuard™ as a trademark and states that the name and branding are not licensed under the GPL.
The software is provided without warranty, including implied warranties of merchantability or fitness for a particular purpose.
