Python Password Generator
Python Password Generator
Python Password Generator
Problem Definition
In this project our motto is to generate a random password based on user's need. User will input
his/her need of no of digits, special character, small alphabets, capital alphabets and based on
these numbers a random password will be generated. After generating the random password a
button of 'Copy to Clipboard' will provide the functionality of copying the generated password
to our clipboard.
It also enables the users to check the strength of their passwords that they have had used on
their multipurpose sites. It enables user to check the character they have used to create the
password.
Introduction
Passwords remain a very widely used method for user authentication, despite widely shared
concerns about the level of security they provide. There are many potential replacement
technologies, including combinations of biometrics and trusted personal devices, but it seems
likely that it will be some time before passwords are relegated to history. Given their current and
likely future wide use, finding ways of improving the use and management of passwords remains
a vitally important issue. We focus here on an important practical matter, namely how to make
password more secure and more convenient. Passwords can be stored either locally or on a trusted
server; most browsers provide a local-storage password manager. However, the shortcomings of
password managers have also been widely documented.
Password Generator enables the user to generate the password of their choice like the
number of words, small case alphabets, digits, etc. A Clipboard enables user to copy the password
that is generated using the Password Generator. It also enables the user to check the strength of
the passwords. It also displays the no. of characters, no of alphabets, and no of symbols used in
the passwords.
Description of the modules used
Description of Module_1 (Password_Generator):
In this module we have imported tkinter package and its modules, pyperclip module,random
module.Then initialize tkinter using Tk() method.
A variable of string type has been declared named 'passstr' to store the generated password.
Similarly 4 variables of integer type has been declared named −≫'passlen_smallalpha'
,'passlen_bigalpha' ,'passlen_digits', 'passlen_specialcharac' to store the length of small
alphabet characters, capital alphabet characters, digits, special characters which the user will input
on his/her choice. The above four variables are set to zero initially using IntVar()
A user-defined-function to generate a password will be used named 'generate()'. We have declared
four list −≫ pass1, pass2, pass3, pass4 which will be having small alphabet characters, capital
alphabet characters, digits, special characters as elements in their respective list. A password
string is declared, which is initially empty, 'mylist' list will consist of pass1, pass2, pass3, pass4
as its elements.
Then an infinite While-loop is runned which will append the characters to the 'password' string
one by one & will terminate on a specific condition, condition of all big, small, digits, special
variables being equal to zero(0).
In while loop the 'mylist' list is shuffled and then the shuffled list is copied to 'list1' list.
so the 'list1' is a list having four lists in it(nested lists).Every first element of the nested-lists will
be checked to identify the type of elements of that list.
A For-loop is iterating for four times(from 0 to 3) with the second-indexing being fixed to zero
(list1[q][0])as there are four-nested lists. As we check the first element of the first nested-list, the
corresponding list is taken (pass1 or pass2 or pass3 or either pass4) and character is taken
randomly using random.choice() function ,from that list. And that character is appended to
'password' string. And the corresponding variable is decremented by 1.
Similarly we proceed forward for the remaining three 3 nested lists. Again the While-loop runs,
again the 'mylist' list is shuffled and copied to 'list1' list the same procedure continues. And we
proceed forward for the remaining three 3 nested lists.
Finally this While-loop is terminated when condition1 is true.
(condition1=(small==0 and big==0 and digits==0 and special==0)).And the password is set to
passstr using passstr.set() function.
Description of Module_2(Strength_Checker) -
This module is used to tell the user the strength percent of his/her input password.
As the user inputs his password in the text-field and click on 'Check' button. A percentage will
be displayed indicating the strength of the password. And with the percentage a color box will
also be displayed, red color indicates-weak password, yellow color indicates-medium password,
green color indicates-strong password.
Description of Module_3 (Check_character):
1)Import Libraries
from tkinter import *
import random
2)Initialize window
root=Tk()
root.geometry('400x400')
−≫Label() : It is use to display the the text that users can not modify.
−≫root : It is a name given by programmer to our window.
References
[1] https://docs.python.org/3/library/tkinter.html
[2] https://www.tutorialspoint.com/python3/python_gui_programming.htm
[3] https://www.geeksforgeeks.org/python-tkinter-tutorial/
[4] https://www.geeksforgeeks.org/python-strings/
[5] https://stackoverflow.com/questions/51777956/link-gui-to-main-class
Acknowledgement
We would like to express my special thanks of gratitude to our Prof. Merlin Priya Jacob)who gave us the
golden opportunity to do this wonderful project on the topic Password Genrator, which also helped us in
doing a lot of Research and we came to know about so many new things we are really thankful to you.
Secondly we would also like to thank our friends who helped us a lot in finalizing this project within the
limited time frame.