𧬠DNAPass Password Generator - Written in modern C++, inspired by DNA nucleotide sequences (v0.1.5)
Just like every DNA sequence is unique to each living being, 𧬠DNAPass creates digitally exclusive passwords β unpredictable and packed with high entropy. Built in C++, this secure generator uses DNA-inspired patterns to produce strong, resilient passwords suitable for high-security environments.
With a command-line interface (CLI), users can customize password length from 8 to 128 characters. DNAPassβs algorithm leverages character diversity, ambiguity resolution, and DNA-mimicking variations to deliver robust, one-of-a-kind passwords for developers and cybersecurity enthusiasts.
- π Interactive Web Version
- π Disclaimer
- β¨ Features
- π Requirements
- πΎ Installation
- π Command Line Interface
- πΈ Screenshots
- π¦ Post installation
- π DNAPass Calculation Methodology
- π οΈ Development
- π€ Contributing
- π Release Notes
- π’ Reporting Issues
- π Reporting Bugs
- π‘οΈ Security
- π Changelog
- π License
- π§ Contact
Experience the DNAPass Password Generator directly in your browser! The web version offers all the functionality of the C++ script in an intuitive and responsive interface. Passwords are generated locally in your browser with the Web Crypto API (crypto.getRandomValues()) and are never sent over the network.
The web generator is a Progressive Web App. When you open the link, a bilingual banner (English / Portuguese) asks whether you want to install it:
- Chrome, Edge, Opera, Samsung Internet, Brave: click INSTALL Β· INSTALAR to open the native install dialog.
- iPhone / iPad: tap Share β Add to Home Screen.
- Safari on macOS: choose File β Add to Dock.
- Other browsers: use the browser menu (Install app / Add to Home screen), if available.
Once installed, DNAPass opens in its own window and keeps working offline.
Do not attempt to memorize the passwords generated by this tool. Instead, use a reliable password manager, such as BitwardenΒ©, which I personally recommend. The only password you should memorize is the master password for your password manager's vault, created with a strong combination of uppercase and lowercase letters, numbers, and special characters. Enable two-factor authentication (2FA) whenever possible to enhance security.
- Generates passwords with lengths between 8 and 128 characters.
- Supports uppercase letters, lowercase letters, digits, and special characters β each one can be turned off (
--no-uppercase,--no-lowercase,--no-digits,--no-special), exactly like the toggles of the web version. - Every random decision uses the operating system's cryptographically secure random number generator (CSPRNG):
BCryptGenRandomon Windows,getentropy()on Linux/macOS/BSD. - Uses primary and secondary DNA sequence sets for unique password generation.
- Ensures at least 4 special characters, 2β3 digits, 10% uppercase, and 1 lowercase (for each enabled character type), guaranteed by construction and covered by automated tests.
- Shows an estimated entropy (charset-based upper bound), the same value as the web version.
- Command-line interface for flexible usage (interactive, piped, or with options).
- No external dependencies; uses C++ standard libraries and the OS random source.
Update and install the environments required for the installation.
sudo apt update sudo apt install git sudo apt install cmake sudo apt install g++ sudo apt install clang
After installing the environments, confirm and verify the installed versions.
git --version cmake --version g++ --version clang --version
Cloning the repository to install packages.
git clone https://github.com/gerivanc/dnapass-password-generator.git cd dnapass-password-generator mkdir build cd build cmake .. cmake --build .
Method 1. Call the function by question to generate the password by choosing between 8-128 characters:
./dnapass_generator
Method 2. - Automated Mode. Call to generate the password by choosing a 45-character password. In the function, enter the number of characters between 8 and 128.
echo "45" | ./dnapass_generator
Method 3. - Command-line options. Pass the length and the same options available in the web version:
./dnapass_generator --length 45 # all character types ./dnapass_generator -l 32 --no-special # without special characters ./dnapass_generator 20 --no-uppercase --no-digits # positional length ./dnapass_generator -l 64 --quiet # print only the password ./dnapass_generator --help # list all options
| Option | Description |
|---|---|
-l, --length N |
Password length (8 to 128). If omitted, it is read from standard input (Methods 1 and 2). |
--no-uppercase |
Exclude uppercase letters (web: INCLUDE UPPERCASE = NO) |
--no-lowercase |
Exclude lowercase letters (web: INCLUDE LOWERCASE = NO) |
--no-digits |
Exclude digits (web: INCLUDE DIGITS = NO) |
--no-special |
Exclude special characters (web: INCLUDE SPECIAL CHARACTERS = NO) |
-q, --quiet |
Print only the generated password (useful for scripts) |
-h, --help |
Show the help and exit |
-v, --version |
Show the version and exit |
Disabling uppercase and lowercase together falls back to lowercase letters (same behavior as the web version). Invalid input exits with a non-zero status code.
- Error: "cmake: command not found":
Install CMake with
sudo apt install cmake. - Error: "g++: command not found":
Install
g++withsudo apt install g++. - Error: "./dnapass_generator: No such file or directory":
Ensure the build step completed successfully. Run
lsto check ifdnapass_generatorexists in thebuildfolder. If not, repeat thecmake ..andcmake --build .steps. - Permission denied:
Run
chmod +x dnapass_generatorto make the executable runnable, then try./dnapass_generatoragain.
Method 1. Call the function by question to generate the password by choosing between 8-128 characters. Entering password output length to 8 characters:
Note: Screenshot using the command:
./dnapass_generator. Demonstration image of the output result of the function.
Method 2. - Automated Mode. Call to generate the password by choosing a 45-character password. In the function, enter the number of characters between 8 and 128. Entering password output length to 45 characters.
Note: Screenshot using the command:
echo "45" | ./dnapass_generator. Demonstration image of the output result of the function.
After the first installation, there's no need to reinstall everything in your environment. Simply open the terminal (CLI) in the environment where the repository was installed and access the folder with the command:
cd dnapass-password-generator/buildThen run the desired function to generate passwords as per your needs.
DNAPass generates passwords by:
- Selecting random DNA sequences from primary (90%) or secondary (10%) sets.
- Resolving ambiguous characters (e.g., 'N' to A/T/C/G).
- Adjusting for length, applying the case options, and enforcing character diversity (uppercase, lowercase, digits, special characters) by reserving unique positions.
- Shuffling the final password (Fisher-Yates) to ensure randomness.
All steps use a cryptographically secure random source, in both the C++ CLI and the web version.
See the DNAPASSCALCULATION.md for details.
To contribute to the DNAPass Password Generator, set up a development environment:
git clone https://github.com/gerivanc/dnapass-password-generator.git cd dnapass-password-generator mkdir build cd build cmake .. cmake --build . ctest --output-on-failure # run the automated tests
Install clang-format for code formatting (optional, but recommended):
sudo apt install clang-format # On Debian/Ubuntu # Or use your package manager (e.g., brew on macOS, choco on Windows)
See the CONTRIBUTING.md for contribution guidelines.
Contributions are welcome! Please follow the guidelines in CONTRIBUTING.md.
See the RELEASE.md for detailed release notes for each version.
Help us improve DNAPass Password Generator by reporting bugs or suggesting enhancements to project. To report a bug, suggest a feature, or ask a question:
-
Go to the Issues tab.
-
Click New issue.
-
View the available options and select to: Report Bug and/or Report Issue. For security vulnerabilities, please follow our Security Policy.
If you encounter a bug in the DNAPass Password Generator, please report it using our dedicated Bug Report template. This template ensures that your report includes essential details, such as steps to reproduce, environment information, and logs, enabling us to address issues efficiently. For other types of contributions or inquiries, refer to our CONTRIBUTING.md.
For security vulnerabilities, follow the process in SECURITY.md instead of opening a public issue. We recommend using a password manager and enabling 2FA for enhanced security.
See the CHANGELOG.md for a detailed history of changes to this project.
This project is licensed under the MIT License. See the LICENSE.md for details.
For questions or feedback, please contact: [email protected]