SecurePassGen
A cryptographically secure password generator that provides high-entropy passwords with configurable requirements. Uses platform-native cryptographic APIs (BCrypt on Windows, Security framework on macOS, OpenSSL+getrandom on Linux) for secure random number generation.
Install / Use
/learn @7etsuo/SecurePassGenREADME
SecurePassGen
A cryptographically secure password generator that provides high-entropy passwords with configurable requirements. Uses platform-native cryptographic APIs (BCrypt on Windows, Security framework on macOS, OpenSSL+getrandom on Linux) for secure random number generation.
Security Features
- Uses cryptographically secure random number generation (CSPRNG)
- Implements rejection sampling to eliminate modulo bias
- Enforces minimum character type requirements
- Uses Fisher-Yates shuffle for uniform distribution
- Securely clears sensitive data from memory
- Platform-specific secure random number generation
- Configurable password requirements
- Entropy pool for efficient random number generation
Building from Source
Prerequisites
Windows
- MinGW-w64 or Microsoft Visual C++
- Windows SDK (for BCrypt)
macOS
- Xcode Command Line Tools
- Apple Security Framework (included in macOS)
Linux
- GCC or Clang
- OpenSSL development libraries
- Ubuntu/Debian:
sudo apt-get install libssl-dev - Fedora:
sudo dnf install openssl-devel - Arch:
sudo pacman -S openssl
- Ubuntu/Debian:
Compilation Instructions
Windows (MinGW-w64)
gcc password.c -o password.exe -lbcrypt
Windows (MSVC)
cl password.c bcrypt.lib
macOS
# For both Intel and Apple Silicon
gcc password.c -o password -framework Security
Linux
gcc password.c -o password -lcrypto
Usage
./password <length>
Example:
./password 16
This will generate a password of specified length (minimum 12 characters) that includes:
- At least one uppercase letter
- At least one lowercase letter
- At least one number
- At least one special character
Configuration
You can modify the following defines in password.c:
#define MAX_PASSWORD_LENGTH 128
#define MIN_PASSWORD_LENGTH 12
#define ENTROPY_MULTIPLIER 2
Password requirements can be adjusted by modifying the PasswordRequirements struct initialization in main().
Security Considerations
- The generated passwords are intended for use as user credentials and should be treated as sensitive data.
- The program securely clears sensitive data from memory after use.
- The random number generation uses platform-specific cryptographic APIs.
- The program enforces a minimum password length of 12 characters for security.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Repository Structure
SecurePassGen/
├── .gitignore
├── LICENSE
├── README.md
├── password.c
└── tests/
└── test_password.c # TODO: Add unit tests
TODO
- Add unit tests
- Add CLI options for customizing password requirements
- Add password strength estimation
- Add option to generate multiple passwords
- Add option to exclude similar-looking characters
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
