Skip to content

About

A secure Python password generator with Tkinter GUI and CLI, customizable password lengths, cryptographic randomness, and input validation. Developed during my Auspify Technologies Python Development Internship.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Secure Password Generator

A Python Development Internship Project — Auspify Technologies

📖 Project Overview

Secure Password Generator is a Python application designed to generate strong, customizable passwords using cryptographically secure random selection.

The application provides two ways to generate passwords:

  • Graphical User Interface (GUI): A desktop application built using Tkinter, with interactive controls for generating, viewing, and copying passwords.
  • Command-Line Interface (CLI): A terminal-based alternative that allows users to generate passwords through text-based prompts.

Both versions generate passwords between 12 and 64 characters and ensure that every generated password contains at least one uppercase letter, one lowercase letter, one digit, and one special character.

The project was developed as part of my Python Development Internship at Auspify Technologies, with an emphasis on secure password generation, input validation, usability, and software testing.

🎯 Project Objectives

The main objectives of this project are to:

  1. Generate strong passwords using cryptographically secure randomness.
  2. Allow users to customize password lengths.
  3. Ensure passwords contain a combination of letters, numbers, and symbols.
  4. Provide a user-friendly graphical interface.
  5. Offer an alternative command-line interface.
  6. Allow users to generate multiple passwords without restarting the application.
  7. Handle invalid inputs and provide appropriate feedback.

✨ Features

Secure Password Generation

Passwords are generated using Python's built-in secrets module, which is designed for security-sensitive random generation.

Every generated password contains at least one character from each of the following categories:

  • Uppercase letters (A–Z)
  • Lowercase letters (a–z)
  • Digits (0–9)
  • Special characters (such as !, @, #, $, %, and other punctuation symbols)

The remaining characters are selected from the combined character set, and their positions are randomized using a secure Fisher–Yates shuffle.

Customizable Password Length

Users can select a password length between 12 and 64 characters.

Graphical User Interface

The GUI provides:

  • An interactive password-length slider
  • A Generate Password button
  • A password display field
  • A Show/Hide password control
  • A Copy Password button
  • Status messages and user feedback
  • A resizable desktop window

Command-Line Interface

The CLI provides:

  • Password-length input through the terminal
  • Validation of invalid or unsupported lengths
  • Secure password generation
  • Password output directly in the terminal
  • An option to generate additional passwords
  • A way to exit the program

🛠️ Technologies Used

Technology Purpose
Python 3 Main programming language
Tkinter Desktop graphical user interface
secrets Cryptographically secure random character selection and shuffling
string Character sets for password generation
Python standard library Supporting application functionality

External dependencies: No third-party Python packages are required.

📁 Project Structure

PythonPasswordGenerator/
├── main.py
├── cli_version.py
├── README.md
└── .gitignore

File descriptions:

  • main.py — The primary application, containing the Tkinter GUI and password-generation functionality.
  • cli_version.py — An alternative terminal-based password generator.
  • README.md — Project documentation and usage instructions.
  • .gitignore — Prevents unnecessary local development files from being committed to GitHub.

🚀 Installation and Setup

Step 1: Install Python

Ensure Python 3 is installed on your computer.

You can download Python from the official website:

https://www.python.org/downloads/

After installation, open a terminal or command prompt and check your Python version:

python --version

If Python is installed correctly, the terminal should display the installed version.

On some systems, you may need to use python3 instead of python.

Step 2: Download the Project

You can obtain the project in either of these ways.

Option A — Download from GitHub

  1. Open the project's GitHub repository.
  2. Select Code.
  3. Select Download ZIP.
  4. Extract the downloaded ZIP file.
  5. Open the extracted project folder.

Option B — Clone Using Git

If Git is installed, clone the repository using its URL:

git clone <repository-url>

Then navigate to the downloaded project folder:

cd PythonPasswordGenerator

Replace <repository-url> with the actual GitHub repository URL.

Step 3: Open the Project

You can open the project in PyCharm, Visual Studio Code, or another Python-compatible development environment.

Alternatively, you can run the application directly from a terminal.

No additional Python packages need to be installed.

🖥️ How to Run the Graphical Application

The GUI is the primary and recommended version of this project.

Step 1: Launch the Application

Open a terminal inside the project folder and run:

python main.py

Alternatively, open main.py in PyCharm and select Run.

A desktop window titled Secure Password Generator should appear.

Step 2: Select a Password Length

Use the password-length slider to choose how many characters your password should contain.

The supported range is:

  • Minimum: 12 characters
  • Maximum: 64 characters

Longer passwords generally provide greater resistance to guessing attacks when generated securely.

Step 3: Generate a Password

Click Generate Password.

The application will generate a new password using secure random selection.

The password will contain uppercase letters, lowercase letters, numbers, and special characters.

You can click the Generate Password button again whenever you want a different password.

Step 4: Show or Hide the Password

Use the eye-shaped visibility control beside the password display field.

  • Show: Reveals the generated password as readable characters.
  • Hide: Conceals the password using masking characters.

This feature allows users to inspect their generated passwords while providing a way to hide them from casual observation.

Step 5: Copy the Password

Click Copy Password to copy the generated password to your system clipboard.

You can then paste it into an appropriate password field using Ctrl + V on Windows.

The application provides feedback when the password is copied.

Security reminder: Avoid copying or pasting passwords into untrusted applications. Clipboard contents may be accessible to other software or clipboard-history features.

Step 6: Generate Another Password

Adjust the slider if desired and click Generate Password again.

Each generation produces a newly randomized password.

You do not need to restart the application.

Step 7: Close the Application

Close the application using the window's standard close button.

💻 How to Run the Command-Line Version

The project also includes a terminal-based password generator.

Step 1: Launch the CLI

Open a terminal in the project folder and run:

python cli_version.py

Step 2: Enter the Password Length

When prompted, enter a number between 12 and 64.

For example:

20

The program will generate and display a password containing 20 characters.

Step 3: Generate Another Password

After generating a password, the program asks whether you want to generate another.

Follow the displayed prompt to continue or exit.

Step 4: Handle Invalid Inputs

If you enter an invalid password length, such as:

  • A number below 12
  • A number above 64
  • Text instead of a number
  • An empty input

The program displays an appropriate error message and allows you to provide valid input.

The program also handles invalid responses to its continue-or-exit prompt.

🔒 How the Password Generation Algorithm Works

The application follows these steps:

1. Validate the requested length

The selected password length must be between 12 and 64 characters.

2. Select required characters

The program securely selects at least one character from each required category:

  • Uppercase letter
  • Lowercase letter
  • Digit
  • Special character

3. Fill the remaining positions

Additional characters are selected from the combined character set using secrets.choice() until the requested length is reached.

4. Securely shuffle the characters

The characters are shuffled using the Fisher–Yates algorithm, with secrets.randbelow() used to select random positions.

This prevents the mandatory character categories from always appearing in predictable positions.

5. Display the completed password

The generated password is displayed in the GUI or printed in the terminal, depending on which version the user is running.

Why Use secrets Instead of random?

Python's random module is designed primarily for simulations and general-purpose randomization.

The secrets module is intended for security-sensitive operations, including generating passwords and authentication tokens.

Using secrets provides a more appropriate source of randomness for this application.

Important: Secure password generation does not guarantee complete account security. Users should also avoid password reuse and use appropriate account protections, such as multifactor authentication.

🧪 Testing and Quality Assurance

Both versions underwent planned functional testing to verify expected behavior.

Application Tests Passed Failures
Tkinter GUI 24/24 0
Command-Line Interface 8/8 0
Total 32/32 0

Areas Tested

Password generation

  • Minimum and maximum password lengths
  • Character-category requirements
  • Password generation and regeneration
  • Randomized output across repeated generations

Input handling

  • Valid password lengths
  • Out-of-range password lengths
  • Non-numeric and empty CLI inputs
  • Invalid continuation responses

Graphical interface

  • Password-length slider
  • Generate Password button
  • Show/Hide functionality
  • Clipboard copying
  • Window resizing and layout behavior
  • Status messages and user feedback

Final display verification

Following a window-width adjustment, a 64-character password was confirmed to display fully at the tested opening window size. The Copy Password and Show/Hide controls were also rechecked successfully.

Testing scope: These results represent functional application testing. They do not constitute an independent cryptographic or security audit.

⚠️ Limitations and Considerations

  • The GUI requires a Python environment with Tkinter support.
  • The application is designed for local desktop or terminal use.
  • The GUI's default window size may be constrained by smaller screen resolutions.
  • The application generates passwords but is not a password manager.
  • Generated passwords are not intended to be stored or synchronized by the application.
  • Users remain responsible for storing their passwords securely.

📚 Skills Demonstrated

This project demonstrates practical experience with:

  • Python functions and control flow
  • Input validation and exception handling
  • String manipulation
  • Cryptographically secure random generation
  • Fisher–Yates shuffling
  • Tkinter interface development
  • Event-driven programming
  • Clipboard interaction
  • Functional testing and debugging
  • Project documentation

📌 Project Information

Project Name: Secure Password Generator

Internship Program: Python Development Internship

Organization: Auspify Technologies

Task: Task 1 — Password Generator

Project Type: Desktop GUI and Command-Line Application

Development Language: Python

Project Status: Completed and functionally tested

👨‍💻 Developer

Adeniyi Adelosoye


Developed as part of the Auspify Technologies Python Development Internship to demonstrate practical Python programming, secure password generation, graphical interface development, and software testing.

About

A secure Python password generator with Tkinter GUI and CLI, customizable password lengths, cryptographic randomness, and input validation. Developed during my Auspify Technologies Python Development Internship.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages