Skip to content

A command-line tool for generating strong, customizable passwords written in modern C++.

Notifications You must be signed in to change notification settings

0Redaa/secure-password-generator

Repository files navigation

Modern C++ CLI Password Generator

Language

A simple, secure command-line tool for generating strong, customizable passwords, written in Modern C++.

💡 Project Purpose

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 PasswordManager class.
  • 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.

✨ Key Features

  • Customizable Generation: Specify password length and required character types (uppercase, lowercase, numbers, symbols).
  • Secure Randomness: Uses std::mt19937 and std::random_device for high-quality random generation, avoiding the insecure rand().
  • Clean CLI: A user-friendly command-line interface for parsing arguments.
  • Fully Documented: Doxygen-ready comments throughout the codebase.

⚙️ Installation & Compiling

No installation is required. You can compile the project from the source.

  1. Clone the repository:

    git clone https://github.com/yourusername/secure-password-generator.git
    cd secure-password-generator
  2. Compile the source files using a C++ compiler (like g++):

    g++ -o passgen main.cpp password_manager.cpp -std=c++17

    (Note: -std=c++17 or -std=c++11 is recommended to support modern features used.)

🚀 Usage

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

About

A command-line tool for generating strong, customizable passwords written in modern C++.

Resources

Stars

Watchers

Forks

Languages