A
Micro Project Report
On
Random Password Generator
Under Subject: Programming With Python(22616)
Semester: VI
Maharashtra State Board of Technical Education, Mumbai
Matoshri Aasarabai Polytechnic, Eklahare, Nashik
Academic Year: 2020-21
Maharashtra State Board of Technical Education, Mumbai
Matoshri Aasarabai Polytechnic, Eklahare, Nashik
CERTIFICATE
This is to certify that following students of SIXTH SEMESTER Diploma Engineering
Program in Computer Engineering have successfully completed the Micro-Project entitled
“Random Password Generator .” under my supervision, in the partial fulfillment of Course
Programming With Python (22616) for Academic Year 2020-2021 as per prescribed in the
MSBTE “I-Scheme” curriculum.
Roll Exam Seat
Enrollment No. Name of Students
No Number
01 1611700285 Kakade Pooja Dyaneshwar
02 1611700288 Khan Shakina Shahid
18 1911700180 Anwat Kalyani Chandrakant
21 1911700185 Borase Manasi Chandrashekar
29 1911700193 Kuwar Sakshi Arun
Date:
Place: Nashik
Subject Teacher Head of Department Principal
Ms.H.R.Waghela Prof. M. D. Sanap Dr. S. J. Bagul
ACKNOWLEDGEMENT
With deep sense of gratitude we would like to thanks all the people who have lit our
path with their kind guidance. We are very grateful to these intellectuals who did their
best to help during our project work.
It is our proud privilege to express deep sense of gratitude to, Dr. S. J. Bagul Principal
of Matoshri Aasarabai Polytechnic, Eklahare, Nashik, for his comments and kind
permission to complete this project.
We remain indebted to Prof. M. D. Sanap, Head of Computer Department, for his
suggestion and valuable guidance.
The special gratitude goes to our internal guide Ms.H.R.Waghela, technical staff
members, and non-technical staff members, of Computer Tech. Department for their
expensive, excellent and precious guidance in completion of this work.
Name of Students:
1. Ms. Kakade Pooja Dyaneshwar
2. Ms. Khan Shakina Shahid
3. Ms. Anwat Kalyani Chandrakant
4. Ms. Borase Manasi Chandrashekar
5. Ms. Kuwar Sakshi Arun
MATOSHRI AASARABAI POLYTECHNIC,EKLAHARE,NASHIK
Department of Computer Engineering
Academic Year-2020-21
Index of Micro Project Report
Programme: Computer Engineering Semester: Sixth
Course: Programming With Python Course Code: 22616
Title of Micro Project : Random Password Generator .
Sr. No. Details Page No.
1 Rubrics
2 Logbook
3 Project Work (Introduction)
4 Project Work (Main Details)
5 Project Work (Conclusion)
6 Resources/ References
ANNEXURE I
Rubric for Evaluation of Micro Project of PWP(22616)
Title of Micro Project: Random Password Generator .
Group Members:
Exam Seat
Roll No Enrollment No. Name of Students
Number
01 1611700285 Kakade Pooja Dyaneshwar
02 1611700288 Khan Shakina Shahid
18 1911700180 Anwat Kalyani Chandrakant
21 1911700185 Borase Manasi Chandrashekar
29 1911700193 Kuwar Sakshi Arun
Marks Indicators for different level of Performance (Evaluation Scale 1 to 6)
Sr
Criteria Obtained
No Poor (1-2) Average(3-4) Good(5-6)
(Out of 6)
Relevance to
1 Relate to some Los Related to at least one CO Take care of at-least Two COs
the course
Content of Not relevant and Relevant and sufficient for Relevant , sufficient for topic
2
project sufficient topic and well organized
Language of Grammatically Grammatically appropriate Grammatically appropriate and
3
Project inappropriate but ineffective effective
Completed within due date Completed and submitted the
Completion of Completed and submitted
4 but took slightly submit complete project within
project after due date.
project. specified due date.
Prepared an improper Prepared appropriate format of
Report Prepared the report with
5 report with unsatisfactory the report with sufficient
Preparation satisfactory content
content content details
Presented with the help of
Not included key points, Included key points but lacks
6 Presentation power point, Highlighted key
missed details considerable
points, information
Resources/ Not referred more than Referred at-least 3 relevant Referred at least 5 relevant
7
References old reference sources sources
Total:
Average
(Out of 6)
Name and Sinature of Guide: (Ms.H.R.Waghela)
MATOSHRI AASARABAI POLYTECHNIC,EKLAHARE,NASHIK
Department of Computer Engineering
Log Book for Micro- Project
Semester: Sixth Programme: Computer Engg.
Course: PWP(22616) Class: Third Year
Topic of the Micro-Project: Random Password Generator .
Roll Exam Seat
Enrollment No. Name of Students
No Number
01 1611700285 Kakade Pooja Dyaneshwar
02 1611700288 Khan Shakina Shahid
18 1911700180 Anwat Kalyani Chandrakant
21 1911700185 Borase Manasi Chandrashekar
29 1911700193 Kuwar Sakshi Arun
Wee
Members Teacher’s Teacher
k Discussion & Details
Present Comment ’s Sign.
No.
Discussion on the concept of Micro project
1
with teacher
Finalization of Group and Project topic with
2
Project Proposal submission
Preliminary discussion with guide about
3
content of Micro project
Related Information Gathered by team about
4
project
5 Organizing the information for project work
Discussing project related queries with
6
teacher if any
Preparation of Micro project model or
7
content
8 Finalizing the project work by teacher
9 Report writing
Presentation , Oral Submission of project
10
and Project report
ANNEXURE II
Evaluation Sheet for the Micro Project
Academic Year: 2020-2021 Name of Faculty: Ms. H.R.Waghela
Course: PWP Course Code: 22616 Semester: Sixth
Title of the Project: Random Password Generator .
COs addressed by the Micro Project:
A. Display message on screen using Python script on IDE.
B. Develop python program to demonstrate use of Operators.
C. Perform operations on data structures in Python.
D. Develop functions for given problem.
E. Design classes for given problem.
F. Handle exceptions.
Major Learning Outcomes achieved by students by doing the Projects:
a) Practical Outcomes ………………………………………
b) Unit Outcomes in Cognitive domain .......................
c) Outcomes in Affective Domain …………………………………………
Comment /Suggestion about team work /Leadership/ Inter-personal communication (If
any)
…………………………………………………………………………………………………
…………………………………………………………………………………………………
…………………………………………………………………………………………………
………………
Roll Exam Seat
Enrollment No. Name of Students
No Number
01 1611700285 Kakade Pooja Dyaneshwar
02 1611700288 Khan Shakina Shahid
18 1911700180 Anwat Kalyani Chandrakant
21 1911700185 Borase Manasi Chandrashekar
29 1911700193 Kuwar Sakshi Arun
(Name & Sign of Faculty)
ABSTRACT
The objective of this project is to create a password generator using python. The password
generator project will be build using python modules like Tkinter, random, string, pyperclip.
In this project, the user has to select the password length and then click on the “Generate
Password” button. It will show the generated password below. If the user clicks on the “Copy
To Clipboard” button, then it will copy the password automatically.
A random password generator is software program or hardware device that takes input from a
random or pseudo-random number generator and automatically generates a password.
Random passwords can be generated manually, using simple sources of randomness such as
dice or coins, or they can be generated using a computer.
While there are many examples of "random" password generator programs available on the
Internet, generating randomness can be tricky and many programs do not generate random
characters in a way that ensures strong security. A common recommendation is to use open
source security tools where possible since they allow independent checks on the quality of
the methods used. Note that simply generating a password at random does not ensure the
password is a strong password, because it is possible, although highly unlikely, to generate an
easily guessed or cracked password. In fact, there is no need at all for a password to have
been produced by a perfectly random process: it just needs to be sufficiently difficult to
guess.
INTRODUCTION
A password generator can be part of a password manager. When a password policy enforces
complex rules, it can be easier to use a password generator based on that set of rules than to
manually create passwords.
Long strings of random characters are difficult for most people to memorize. Mnemonic
hashes, which reversibly convert random strings into more memorable passwords, can
substantially improve the ease of memorization. As the hash can be processed by a computer
to recover the original 60-bit string, it has at least as much information content as the original
string.[1] Similar techniques are used in memory sport.
Password Generator is written in Python using Tkinter for GUI. The project file contains
python scripts (main.py and pwgenfunc.py). This is a simple GUI based project which is very
easy to understand and use. Talking about the system, the user can generate a random
password according to different sizes. In order to generate a password first, the user has to
select a size range using the slider. It also displays with a visual color-coded system which
indicates the strength of the password, starting from Very Weak to Excellent password
strength. After generating a random password, the system displays it in the clipboard where
the user can copy and paste easily.
This GUI based Password Generator provides the simplest way for generating a strong
password for the users. In short, this project only focuses on generating random passwords.
In order to run the project, you must have installed Python, on your PC. This is a simple GUI
Based system, specially written for the beginners. Password Generator in Python with
source code is free to download. Use for education purpose only! For the project demo,
have a look at the image slider below.
Features:
Displays Password Strength
Select password size
With growing technology, everything has relied on data and securing these data is the main
concern. Passwords are meant to keep the data safe that we upload on the Internet.
An easy password can be hacked easily and all the personal information can be misused. In
order to prevent such things and keep the data safe, it is quite necessary to keep our
passwords very strong.
Let’s create a simple application which can randomly generate strong passwords using
Python Tkinter module.
This application can generate random password, with the combination of letters, numerics,
and special characters. One can mention length of the password based on requirement and
can also select the strength of the password.
Project Prerequisites
To build this project we will use the basic concept of python and libraries – Tkinter,
pyperclip, random, string.
Tkinter is a standard GUI library and is one of the easiest ways to build a GUI application.
pyperclip module allows us to copy and paste text to and from the clipboard to your computer
The random module can generate random numbers
string module contains a number of functions to process the standard python string.
To install the libraries we can use pip installer from the command line:
pip install tkinter
pip install pyperclip
pip install random
pip install strings
Project File Structure
Let’s check the step to build a Password Generator using Python
Import modules
Initialized Window
Select Password Length
Define Functions
Steps to create random password generator
1. Import Libraries
The first step is to import libraries
from tkinter import *
import random, string
import pyperclip
2. Initialize Window
root = Tk()
root.geometry("400x400")
root.resizable(0,0)
root.title("DataFlair - PASSWORD GENERATOR")
Tk() initialized tkinter which means window created
geometry() set the width and height of the window
resizable(0,0) set the fixed size of the window
title() set the title of the window.
Label(root, text = 'PASSWORD GENERATOR' , font ='arial 15 bold').pack()
Label(root, text ='DataFlair', font ='arial 15 bold').pack(side = BOTTOM)
Label() widget use to display one or more than one line of text that users can’t able to
modify.
root is the name which we refer to our window
text which we display on the label
font in which the text is written
pack organized widget in block
3. Select Password Length
pass_label = Label(root, text = 'PASSWORD LENGTH', font = 'arial 10 bold').pack()
pass_len = IntVar()
length = Spinbox(root, from_ = 8, to_ = 32 , textvariable = pass_len , width = 15).pack()
pass_len is an integer type variable that stores the length of a password.
To select the password length we use Spinbox() widget.
Spinbox() widget is used to select from a fixed number of values. Here the value from 8
to 32
4. Function to Generate Password
pass_str = StringVar()
def Generator():
password = ''
for x in range (0,4):
Password = random.choice(string.ascii_uppercase) +
random.choice(string.ascii_lowercase) + random.choice(string.digits) +
random.choice(string.punctuation)
for y in range(pass_len.get()- 4):
password = password + random.choice(string.ascii_uppercase +
string.ascii_lowercase + string.digits + string.punctuation)
pass_str.set(password)
pass_str is a string type variable that stores the generated password
password = “” is the empty string
First loop will generate a string of length 4 which is a combination of an uppercase
letter, a lowercase letter, digits, and a special symbol and that string will store in
password variable.
The second loop will generate a random string of length entered by the user – 4 and add
to the password variable. Here we minus 4 to the length of the user because we already
generate the string of length 4.
We have done this because we want a password which must contain an uppercase, a
lowercase, a digit, and a special symbol.
Now the password is set to the pass_str() variable.Button(root, text = "GENERATE
PASSWORD" , command = Generator ).pack(pady= 5)
Entry(root , textvariable = pass_str).pack()
Button() widget used to display button on our window
command is called when the button is click
Entry() widget used to create an input text field
textvariable used to retrieve the current text to the entry widget
5. Function to Copy Password
def Copy_password():
pyperclip.copy(pass_str.get())
Button(root, text = 'COPY TO CLIPBOARD', command =
Copy_password).pack(pady=5)
pyperclip.copy() used to copy the text to clipboard
Python Password Generator Output
SOURCE CODE
# Python program to generate random
# password using Tkinter module
import random
import pyperclip
from tkinter import *
from tkinter.ttk import *
# Function for calculation of password
def low():
entry.delete(0, END)
# Get the length of password
length = var1.get()
lower = "abcdefghijklmnopqrstuvwxyz"
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
digits =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
!@#$%^&*()"
password = ""
# if strength selected is low
if var.get() == 1:
for i in range(0, length):
password = password + random.choice(lower)
return password
# if strength selected is medium
elif var.get() == 0:
for i in range(0, length):
password = password + random.choice(upper)
return password
# if strength selected is strong
elif var.get() == 3:
for i in range(0, length):
password = password + random.choice(digits)
return password
else:
print("Please choose an option")
# Function for generation of password
def generate():
password1 = low()
entry.insert(10, password1)
# Function for copying password to clipboard
def copy1():
random_password = entry.get()
pyperclip.copy(random_password)
# Main Function
# create GUI window
root = Tk()
var = IntVar()
var1 = IntVar()
# Title of your GUI window
root.title("Random Password Generator")
# create label and entry to show
# password generated
Random_password = Label(root, text="Password")
Random_password.grid(row=0)
entry = Entry(root)
entry.grid(row=0, column=1)
# create label for length of password
c_label = Label(root, text="Length")
c_label.grid(row=1)
copy_button = Button(root, text="Copy", command=copy1)
copy_button.grid(row=0, column=2)
generate_button = Button(root, text="Generate", command=generate)
generate_button.grid(row=0, column=3)
# Radio Buttons for deciding the
# strength of password
# Default strength is Medium
radio_low = Radiobutton(root, text="Low", variable=var, value=1)
radio_low.grid(row=1, column=2, sticky='E')
radio_middle = Radiobutton(root, text="Medium", variable=var, value=0)
radio_middle.grid(row=1, column=3, sticky='E')
radio_strong = Radiobutton(root, text="Strong", variable=var, value=3)
radio_strong.grid(row=1, column=4, sticky='E')
combo = Combobox(root, textvariable=var1)
# Combo Box for length of your password
combo['values'] = (8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, "Length")
combo.current(0)
combo.bind('<<ComboboxSelected>>')
combo.grid(column=1, row=1)
# start the GUI
root.mainloop()
OUTPUT
CONCLUSION
With these steps, we have successfully created a random password generator project
using python. We used popular tkinter library to rendering graphics in our display
window and we also learned about pyperclip and random library.
We learned how to create buttons, input textfield, labels, and spinbox. In this way, we
successfully created our password generator python project. Hope you enjoyed it.
REFERENCES
a. https://www.tutorialspoint.com/python/index.htm
b. https://www.w3school.com/python/default.asp
c. https://spoken-tutorial.org/
d. https://www.programiz.com/python-programming
e. https://www.w3resource.com/python-exercises/
f. https://www.anandology.com/python-practice-book/
g. https://docs.python.org/3/tutorial/errors.html