This project is a Python script designed for generating secure keys with various complexities and validating their strength. It provides functionalities to create secure keys for different purposes, including JWT (JSON Web Tokens), and includes validation mechanisms to ensure the generated keys meet security standards.
- Key Generation: Generate secure keys with different complexity levels (medium, high, ultra).
- JWT Key Generation: Create secure keys specifically for JWT with added entropy.
- Key Validation: Validate the strength of generated keys based on length, character diversity, and other security metrics.
- Backup Keys: Generate backup keys for added security.
To set up the project, follow these steps:
- Clone the repository:
git clone https://github.com/alimahdibahrami/SecureKeyGenerationScript.git - Navigate to the project directory:
cd SecureKeyGenerationScript - Install the required dependencies:
pip install -r requirements.txt
To generate secure keys, run the generate_keys.py script:
python src/generate_keys.py
This will generate a SECRET_KEY, JWT_SECRET_KEY, and backup keys, displaying them in the console and saving them to a file named generated_keys.txt.
To run the tests for the project, navigate to the tests directory and execute:
pytest
This will run all unit tests defined in the test_generate_keys.py and test_key_validator.py files.
For best practices on key management and usage, refer to the docs/security_guidelines.md file.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.