Secure Password Generator is a command-line tool for generating secure passwords. The program supports customization of password length, the inclusion of symbols or special characters, and the ability to generate multiple passwords at once. Additionally, it allows users to write the generated passwords to a file or append them to an existing file, and copy the passwords to the clipboard, providing flexible output options for different use cases.
- Generate secure passwords with a specified length (default length: 20)
- Command-line switches for controlling password length, symbols or special character inclusion, and quiet mode
- Option to generate multiple passwords at once
- Supports writing generated passwords to a file or appending them to an existing file
- Supports copying generated passwords to the clipboard on Windows, Linux, and macOS
The program is implemented in C++ and uses the C++11 random number library for generating random characters. It uses a cryptographically secure pseudo-random number generator to ensure the generated passwords are secure.
- C++11 compatible compiler
- CMake 3.10 or higher
- Clone the repository:
git clone https://github.com/chatgptdev/SecurePasswordGenerator.git
cd SecurePasswordGenerator
- Create a build directory:
mkdir build && cd build
- Run CMake to generate build files:
cmake ..
- Build the project:
cmake --build .
The secure_password_generator binary will be created in the build directory.
Usage: secure_password_generator [OPTIONS]
Generate secure passwords with optional constraints.
Options:
-l LENGTH Set the password length (default: 20, minimum: 6)
-b Require at least one symbol character('+','-','/' or '*')
-s Require at least one special character
-n NUM Generate NUM passwords (default: 1)
-q Quiet mode - only print passwords
-f FILE Write passwords to FILE (-a to append, otherwise overwrite)
-a Append passwords to the file specified with -f
-c Copy generated passwords to the clipboard (no console outputin this case)
-h Display this help message and exit
ChatGPT 4.0 based on prompts by @chatgptdev ([email protected])