Skip to main content

Secure and customizable password generator.

Project description

Klefki - Secure Password Generator

Klefki is a highly secure and customizable password generator written in Python. It allows users to generate strong passwords with varying levels of complexity and even integrate a custom base word into the password. Klefki supports both interactive and command-line interfaces for maximum flexibility.

Features

  • Dual Interface: Interactive menu or command-line arguments
  • Clipboard Integration: Automatically copy passwords to clipboard with --copy flag
  • Customizable Complexity: Choose from 4 levels of complexity:
    • Level 1: Lowercase letters only
    • Level 2: Letters and digits
    • Level 3: Letters, digits, and symbols
    • Level 4: Max complexity (guarantees all character types)
  • Custom Base Word: Optionally embed a base word into the password
  • Randomized Character Shuffling: Characters are randomly shuffled to prevent predictability
  • Security: Uses Python's secrets module for cryptographically secure randomization

Installation

Install the required dependency for clipboard functionality:

pip install pyperclip

Requirements:

  • Python 3.6+
  • pyperclip (for clipboard functionality)

You can install Klefki directly via pip after cloning the repository:

pip install .

Or, after publication on PyPI:

pip install klefki-gen

Usage

After installation, simply run:

klefki

Or use via CLI:

klefki -l 16 -c 4 --copy

Interactive Mode

Run without arguments to enter interactive mode:

python3 main.py

Command-Line Interface

Generate passwords directly from command line:

# Basic usage
python3 main.py -l 16 -c 3

# With base word
python3 main.py -l 20 -c 4 -b "secure"

# Copy to clipboard automatically
python3 main.py -l 12 -c 3 --copy

CLI Arguments

  • -l, --length: Password length (required for CLI mode)
  • -c, --complexity: Complexity level 1-4 (required for CLI mode)
  • -b, --base: Base word to include (optional)
  • --copy: Copy password to clipboard automatically

Example Usage

Interactive Mode

Welcome to the Interactive Password Generator!
Enter password length: 12

Complexity levels:
1 - Lowercase letters
2 - Letters and digits
3 - Letters, digits, symbols
4 - Max complexity (guarantees all types)
Choose complexity (1-4): 3
Optional base word: secure

Your password: a9$ecurelP!#

Copy to clipboard? (y/n): y
Password copied to clipboard!
Generate another? (y/n): n
Goodbye!

Command-Line Mode

$ python3 main.py -l 16 -c 4 -b "test" --copy
K8#testM2@pL9$vX
Password copied to clipboard!

Code Overview

  • generate_password(): Core password generation with complexity levels and base word integration
  • display_menu(): Interactive user interface with improved UX
  • cli(): Command-line argument parsing and execution
  • Uses argparse for robust CLI argument handling
  • Integrates pyperclip for seamless clipboard operations

Security Notes

Klefki prioritizes security by:

  • Using Python's secrets module for cryptographically secure randomization
  • Shuffling characters to prevent base word pattern detection
  • Supporting maximum complexity mode that guarantees character type diversity

Possible Improvements

  • Add a graphical user interface (GUI) using tkinter.
  • Add command-line arguments to allow non-interactive usage.
  • Include more advanced password strength analysis and feedback.

Contributing

Contributions are welcome! If you'd like to add features or fix issues, feel free to open a pull request.

License

This project is open-source and licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klefki_gen-1.0.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

klefki_gen-1.0.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file klefki_gen-1.0.5.tar.gz.

File metadata

  • Download URL: klefki_gen-1.0.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for klefki_gen-1.0.5.tar.gz
Algorithm Hash digest
SHA256 9adf71194100d252cb325c08a7d5b9cb8fc12b8d2e416021e95398b5433ea6a4
MD5 123cd1832c78d63cb6b93917e448c931
BLAKE2b-256 d58bc5f91935e934396549fb8fa8a11f0ff0e6fdfd28c065c5a1d02d58ad8349

See more details on using hashes here.

File details

Details for the file klefki_gen-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: klefki_gen-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for klefki_gen-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dc59bb38ba024ccc8e1ccb30564d6197911103a614e9494d342c9ff92e4aa91f
MD5 4bb49d4320379e952fb317a990f2acba
BLAKE2b-256 dd05d1714db9187932fd63dba23288c69d027030d9f7dd8465cf3de41dd14963

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page