A simple, secure command-line tool for generating strong, customizable passwords, written in Modern C++.
This project is more than just a utility; it's a practical demonstration of clean, modern C++ development practices.
While the function is simple, the implementation showcases:
- Object-Oriented Design: A clear separation of concerns using a
PasswordManagerclass. - Modern C++ (C++11/17): Use of smart pointers (
std::unique_ptr) for RAII-compliant memory management and the<random>library (std::mt19937) for secure pseudo-random number generation. - Professional Documentation: Full Doxygen-style comments (
@brief,@param, etc.) for all classes, methods, and files. - Clean Code: A focus on readability, robust error handling (using
STATUS_CODE), and a well-structured command-line interface.
- Customizable Generation: Specify password length and required character types (uppercase, lowercase, numbers, symbols).
- Secure Randomness: Uses
std::mt19937andstd::random_devicefor high-quality random generation, avoiding the insecurerand(). - Clean CLI: A user-friendly command-line interface for parsing arguments.
- Fully Documented: Doxygen-ready comments throughout the codebase.
No installation is required. You can compile the project from the source.
-
Clone the repository:
git clone https://github.com/yourusername/secure-password-generator.git cd secure-password-generator -
Compile the source files using a C++ compiler (like g++):
g++ -o passgen main.cpp password_manager.cpp -std=c++17
(Note:
-std=c++17or-std=c++11is recommended to support modern features used.)
Run the compiled executable from your terminal.
Options:
-u,--upper: Include uppercase letters (A-Z).-m,--lower: Include lowercase letters (a-z).-n,--numbers: Include numbers (0-9).-s,--symbols: Include special symbols (!@#$...).-l <num>,--length <num>: Set the desired password length (min 12).-h,--help: Show the help message.
Example:
To generate a 16-character password with uppercase, lowercase, and numbers:
./passgen -u -m -n -l 16