This project is a Command-Line Interface (CLI) application that generates cryptographically secure, high-entropy passwords.
Developed as Project 3 for the DecodeLabs Industrial Training Kit (Batch 2026), this tool transitions away from basic scripting toward enterprise-level system architecture. It demonstrates how to leverage Python's standard library to handle security-critical tasks, focusing on cryptographic randomness, memory efficiency, and compliance with modern password standards.
-
Cryptographic Security (The
secretsModule): Unlike standard generators that use the deterministicrandommodule (which relies on the predictable Mersenne Twister), this tool utilizes Python'ssecretsmodule. This taps into hardware-level OS noise to generate truly unpredictable data suitable for enterprise authentication. - NIST 2024 Compliance: Aligns with modern security guidelines by prioritizing password length over forced complexity to maximize mathematical information entropy. The system issues a warning if a user attempts to generate a password shorter than the recommended 8 characters.
-
Optimized Memory Management ($O(N)$): Uses the
''.join()method for string generation. This achieves highly efficient linear time complexity by allocating memory exactly once, bypassing the heavy overhead of creating temporary objects in an immutable string concatenation loop. -
Robust Character Pooling: Dynamically integrates
string.ascii_letters,string.digits, andstring.punctuationfor a locale-independent, maximum-entropy character pool, avoiding tedious and error-prone manual arrays. -
Defensive Coding: Features a
try-except ValueErrorblock to handle invalid, non-numeric user inputs gracefully without crashing the system.
- The IPO Scaffold: The application is built on the Input (Integer gathering & validation), Process (Cryptographic selection & string generation), and Output (Secure string delivery) architectural model.
- Standard Library Integration: Fully relies on verified Python built-in components (
secretsandstring) to ensure performance optimization and security, rather than using custom arrays or external dependencies.
- Python 3.6+ must be installed on your system (this is required for the
secretsmodule). No external libraries are needed.
- Clone this repository to your local machine:
git clone [https://github.com/harshsharma45/RandomPasswordGenerator.git](https://github.com/harshsharma45/RandomPasswordGenerator.git)
2. Open your terminal or command prompt.
3. Navigate to the project directory:
```bash
cd RandomPasswordGenerator
- Run the application using the following command:
python main.py
(Note: Replace main.py with the actual name of your file if it is different).
Upon running the script, you will see the main prompt:
Welcome to the Enterprise Random Password Generator
Enter the length of password to generate (Minimum 8 recommended):
- Type an integer (e.g.,
16) and press Enter. - The engine will instantly calculate and output a cryptographically secure string (e.g.,
A!B9c$D#ΣA). - If you input a value less than 8, the system will process the request but issue a NIST guideline warning.
- If you input a non-integer (like "ten"), the defensive barrier will catch the error and prompt you for valid numerical data.