D.K.T.E.
Society’s
Yashawantrao Chavan Polytechnic, Ichalkaranji.
Department of
Computer Science and
Engineering
A
MICRO PROJECT
REPORT
ON,
“Random Password
Generator’’
SUBMITTED BY,
Sr Enrollmet Student Name Sign
. No.
No
Under the Guidance of
Academic Year
2024-25
D.K.T.E. SOCIETY’S
YASHAWANTRAO CHAVAN POLYTECHNIC,
ICHALKARANJI.
DEPARTMENT OF
COMPUTER SCIENCE AND
ENGINEERING
CERTIFICATE
THIS IS TO CERTIFY,
Seat.No Enrollmet Student Name Sign
No.
HAVE SUCCESSFULLY COMPLETED THE PROJECT DESIGN WORK
ENTITLED,
“Random Password Generator’’
Inpartial fulfilment of Diploma in Computer Science and Engineering at MSBTE,
Mumbai.
DATE:
PLACE: ICHALKARANJI
Mr. R.A.Hatgine Mr. A.P.Kothali
(GUIDE) (HOD) (PRINCIPAL)
ACKNOWLEDGEMENT
An endeavour over long period can be successful only with advice and guidance
of many well-wishers. We thanks to HOD Mr. R. A. Hatgine, of Second year for this
opportunity. We would like to thank the Computer Science and Engineering department
for assistance and constant source of encouragement.
We wish to express our profound and deep sense of gratitude to Mr. for sparing
their valuable time to extend help in every step of our project.
Name of Group Members,
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.
INDEX
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
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