Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
52 views20 pages

Password Generator Project Raj

The document outlines a project titled 'Password Generator Using Python' submitted by Rajkumar for Class 11-B at Chandan Bal Vikas Public School. It details the project's objectives, tools used, and the importance of strong passwords, along with a structured flow of how the password generator operates. The project includes source code, examples of generated passwords, and emphasizes the learning experience gained through coding and understanding password security.

Uploaded by

rajghalyan20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views20 pages

Password Generator Project Raj

The document outlines a project titled 'Password Generator Using Python' submitted by Rajkumar for Class 11-B at Chandan Bal Vikas Public School. It details the project's objectives, tools used, and the importance of strong passwords, along with a structured flow of how the password generator operates. The project includes source code, examples of generated passwords, and emphasizes the learning experience gained through coding and understanding password security.

Uploaded by

rajghalyan20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

CHANDAN BAL VIKAS PUBLIC

SCHOOL
Project Title: Password Generator
Using Python
Submitted by: Rajkumar
Class: 11 - B
Submitted to: Ishika Ma'am
Academic Year: 2024–2025
Acknowledgement
I would like to express my sincere gratitude to **Ishika Ma’
am**, my Computer Science teacher, for her valuable guidance,
constant support, and encouragement during this project. I
also thank **Chandan Bal Vikas Public School** for providing
a platform to explore the practical aspects of programming.
Finally, I thank my parents and friends for their continuous
encouragement.
Certificate
This is to certify that **Rajkumar**, a student of Class 11 -
B, has successfully completed the project work titled

**“Password Generator Using Python”**

under the guidance of **Ms. Ishika**, during the academic


session 2024–2025 in partial fulfillment of the curriculum
of Computer Science.

Signature of Teacher: __________________


Date: __________________
Index
1. Introduction

2. Objective

3. Tools Used

4. What is a Password Generator?

5. Importance of Strong Passwords

6. Python Concepts Used

7. Project Flow

8. Source Code

9. Output Example

10. Code Explanation

11. Advantages

12. Conclusion

13. Bibliography
Introduction
This project is about building a Password Generator using
Python. Passwords are essential for protecting our online
data and privacy. A strong password generator helps users
create secure and unpredictable passwords to safeguard
personal and professional accounts.
Objective
- To build a random password generator using Python.
- To understand string manipulation and the use of libraries
like random and string.
- To create user-friendly command-line interaction.
- To apply real-world logic through coding.
Tools Used
- Programming Language: Python 3.x
- IDE/Editor: IDLE / VS Code / Jupyter Notebook
- Modules Used: random, string
What is a Password Generator?
A password generator is a software tool that creates strong,
secure, and random passwords using combinations of alphabets,
numbers, and symbols. It reduces the risk of password
cracking or brute-force attacks.
Importance of Strong Passwords
- Prevents unauthorized access
- Protects online accounts and banking
- Reduces chances of identity theft
- Avoids easy-to-guess passwords like '123456' or 'password'
Python Concepts Used
- print() and input() functions
- if-else conditions
- for and while loops
- String operations
- random.choice(), string.ascii_letters, string.digits,
string.punctuation
- Custom functions
Project Flow
1. Take user input for password length
2. Ask whether to include uppercase, lowercase, digits,
symbols
3. Build character pool
4. Use random.choice() to select characters
5. Generate one or more passwords
6. Evaluate and display password strength
Output Example
Welcome to the Advanced Password Generator!
Enter desired password length: 12
Include uppercase letters? (y/n): y
Include lowercase letters? (y/n): y
Include numbers? (y/n): y
Include special characters? (y/n): y
How many passwords to generate?: 2

Generated Password(s):
1. aZ8!gT7#LpQe (Strength: Strong)
2. M@3xZk!5QrNc (Strength: Strong)
Code Explanation
- The program asks the user for inputs like length and
character types.
- Based on input, a character pool is created.
- Passwords are randomly generated using this pool.
- A strength checker tells if the password is strong or weak.

- The code is modular with reusable functions.


Advantages
- Creates secure passwords
- User-friendly
- Supports multiple passwords
- Useful for developers, students, and general users
Conclusion
This project was a great learning experience. I learned how
to use Python functions, loops, and the random module. It
also made me aware of how important secure passwords are in
today’s digital world.
Bibliography
- Python Official Documentation: https://docs.python.org
- W3Schools Python Tutorial
- GeeksForGeeks Python
- Class notes and practicals
Source Code
import random
import string

def get_user_preferences():
print("Welcome to the Advanced Password Generator!")
try:
length = int(input("Enter desired password length:
"))
if length < 4:
print("Password length should be at least 4
characters.")
return None
except ValueError:
print("Invalid input. Please enter a number.")
return None

include_upper = input("Include uppercase letters? (y/n):


").lower() == 'y'
include_lower = input("Include lowercase letters? (y/n):
").lower() == 'y'
include_digits = input("Include numbers? (y/n):
").lower() == 'y'
include_symbols = input("Include special characters?
(y/n): ").lower() == 'y'

if not any([include_upper, include_lower, include_digits,


include_symbols]):
print("At least one character type should be
selected.")
return None

try:
count = int(input("How many passwords to generate?:
"))
if count < 1:
print("Number of passwords should be at least
1.")
return None
except ValueError:
print("Invalid number.")
return None

return {
'length': length,
'include_upper': include_upper,
'include_lower': include_lower,
'include_digits': include_digits,
'include_symbols': include_symbols,
'count': count
}

def generate_password(length, include_upper, include_lower,


include_digits, include_symbols):
character_pool = ''
if include_upper:
character_pool += string.ascii_uppercase
if include_lower:
character_pool += string.ascii_lowercase
if include_digits:
character_pool += string.digits
if include_symbols:
character_pool += string.punctuation

return ''.join(random.choice(character_pool) for _ in


range(length))

def check_password_strength(password):
score = 0
if any(c.islower() for c in password): score += 1
if any(c.isupper() for c in password): score += 1
if any(c.isdigit() for c in password): score += 1
if any(c in string.punctuation for c in password): score
+= 1

strength = {
1: "Very Weak",
2: "Weak",
3: "Moderate",
4: "Strong"
}
return strength.get(score, "Unknown")
def main():
prefs = get_user_preferences()
if not prefs:
return

print("\nGenerated Password(s):")
for i in range(prefs['count']):
pwd = generate_password(
prefs['length'],
prefs['include_upper'],
prefs['include_lower'],
prefs['include_digits'],
prefs['include_symbols']
)
strength = check_password_strength(pwd)
print(f"{i+1}. {pwd} (Strength: {strength})")

if __name__ == "__main__":
main()

You might also like