GenerateKey is a simple Python tool designed to generate secure secret keys and user passwords. It can be used both as a command-line utility and as a library within other Python projects.
• Secret Key Generation: Create URL-safe base64-encoded secret keys of customizable byte length, suitable for cryptographic purposes such as signing tokens or encrypting data. • User Password Generation: Generate random user passwords of customizable length, including uppercase and lowercase letters, digits, and punctuation symbols.
You can install GenerateKey using pip:
pip install generatekeyCommand-Line Interface
GenerateKey provides a CLI for generating keys and passwords directly from the terminal.
• Display Help To see the available commands and options, run:
generatekey -h• Generate a Secret Key with Default Settings (64 bytes)
generatekey secretkey• Generate a Secret Key with a Specific Number of Bytes
generatekey secretkey --nbyte 32• Generate a User Password with Default Length (12 characters)
generatekey userpass• Generate a User Password with a Specific Length
generatekey userpass --length 16You can also import GenerateKey into your Python projects:
from generatekey import get_secret_key, generate_user_password
# Generate a secret key of 32 bytes
secret_key = get_secret_key(nbytes=32)
print(f"Secret Key: {secret_key}")
# Generate a user password of length 16
password = generate_user_password(length=16)
print(f"User Password: {password}")• Python 3.10 or higher
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes with descriptive commit messages.
- Push your branch to your forked repository.
- Create a pull request to the main repository.
• All tests pass. • Your code follows the project’s coding style. • You have updated the documentation if necessary.
This project is licensed under the MIT License. See the [ file for details.
• Thanks to the contributors of open-source libraries used in this project. • Inspired by the need for simple and secure key and password generation tools.
If you encounter any issues or have questions, feel free to open an issue on the GitHub [.
Version 0.1.0
• Initial release • Command-line interface for generating secret keys and user passwords • Functions available for import into other Python projects • Unit tests covering main functionalities
Feel free to modify this README to better suit your project’s specifics, such as updating URLs, adding badges, or including additional sections like a table of contents or FAQs.