You are on page 1of 15

COMPUTER PROJECT ON THE TOPIC

“SECURE PASSWORD GENERATOR USING


PYTHON.”
AS A PART OF12th BOARD PRACTICAL EXAMINATION CONDUCTED
BY C.B.S.E.

ALL INDIA SENIOR SECONDARY CERTIFICATE


EXAMINATION

Submitted By
Sourabh S
ROLL NO:
UNDER THE SUPERVISION OF

MRS. PAVITHRA R

NATIONAL ACADEMY FOR LEARNING


BENGALURU
(Affiliated to C.B.S.E No.830060)
Bellary Road, Next to Kempegowda International Airport
Ozone Urbana Residential Complex
Bengaluru - 562110
Phone: 080 29728882
Email:info@npsurbana.com
LABORATORY CERTIFICATE

This is to certify that SOURABH S of class XII A during the


academic year 2020-21, has satisfactorily completed his Computer
Science Project entitled “SECURE PASSWORD MANAGER
USING PYTHON” under my guidance. he has taken proper care and
shown at most sincerity in completing his project.
I certify that the project is up to my expectations and follows the
guidelines as prescribed by CBSE, AISSCE.

Teacher-in-Charge:

PAVITHRA R ----------------

(Signature)

Mr. /Mrs. ----------------------- ----------------

(External Examiner) (Signature)

----------------

(Signature)

Ms. HEMALATA PILLAI

Principal

National Academy For Learning - North Bengaluru


ACKNOWLEDGEMENT

I wish to place on record my sincere thanks to the


Management of National Academy For Learning and
Vice Principal Ms. Hemalata Pillai, for having given me
the opportunity to study here and provide all the support.
I am also indebted to my teacher Mrs. Pavithra R for her
encouragement and motivation. Without her guidance, this
project would not have been possible.

Name: SOURABH S
Roll no:06
INDEX
SECTION TOPIC PAGE No.

1. Overview of Python 1

2. Project Synopsis 2

3. System Requirement 3

4. Modules Used 4-5

5. Program Code 6-7

6. Program Output 8

7. Limitations 9

8. Bibliography 10
SECTION 1:
PYTHON OVERVIEW
 
Python is a high level interpreted interactive and object oriented scripting
language. 
Python is designed to be highly readable .It uses English Keywords frequently
where as other languages use punctutation, and it has fewer syntactical
constructions than other languages. 
History of Python 
Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathe- matics and Computer
Science in the Netherlands. 
Python is derived from many other languages, including ABC, Modula-
3,C, C++,Algol-68,SmallTalk, and Unix shell and other scripting languages. 

Advantages of python are:


 
 Presence of Third Party Modules: ...
 Extensive Support Libraries: ...
 Open Source and Community Development: ...
 Learning Ease and Support Available: ...
 User-friendly Data Structures: ...
 Productivity and Speed

1
Project Synopsis
Password generator and password logger using python.

It creates strong passwords which make it hard for black-hat hackers to crack it. It also stores
it locally as a QR code for easy access in the future.

The purpose of the project is to build an application program to reduce the manual work of
making strong passwords and remembering them.

Features of Password Generator are:

• It makes extraordinarily strong passwords ranging from 6 to 22 characters in them.

• It has the ability to store it locally in the form of a QR code

• QR code can be easily scanned for easy access in the future.

• It has no loose ends which means it has a very little chance of giving a user error.

• Reduce time consumption

• Easy operations for operator of the system

• No paper work requirement

2
System Requirement

Hardware and Software Requirements


Min Processor Type Intel 386 or higher

Min RAM Size 512 MB

Min Hard Drive Space 1 GB

OS Required Windows,linux,macOS

Min Processor Type Intel 386 or higher

Product Line python3

Localization English

Compatibility PC, Developer boards, etc

3
Modules Used For This Project
 OS - The OS module in Python provides functions for interacting with the operating

system. OS comes under Python's standard utility modules

 Time - The Python time module provides many ways of representing time in code,

such as objects, numbers, and strings. It also provides functionality other than

representing time, like waiting during code execution and measuring the efficiency of

your code.

 Pip - pip is a package manager for Python. That means it's a tool that allows you to

install and manage additional libraries and dependencies that are not distributed as

part of the standard library.

 Subprocesses - The subprocess module allows you to spawn new processes, connect

to their input/output/error pipes, and obtain their return codes. This module intends to

replace several older modules and functions: os.

 Random - The random module is a built-in module to generate the pseudo-

random variables. It can be used perform some action randomly such as to get

a random number, selecting a random elements from a list, shuffle elements randomly,

etc.

 Array - Python array module gives us an object type that we can use to denote

an array. This is a collection of a type of values. In a way, this is like a Python list, but

we specify a type at the time of creation.

 Png - PyPNG allows PNG image files to be read and written using pure Python.

4
Conversion to and from PAM files means that on the command line, processing PAM

files can be mixed with processing PNG files

 Pyqrcode - The pyqrcode module is a QR code generator that is simple to use and

written in pure python. The module can automates most of the building process for

creating QR codes. Most codes can be created using only two lines of code!

5
Program Code
#password generator
import pip
import os
import subprocess
import sys
import random #to generate random password
import array
import time
while True:
try:
import png
import pyqrcode
break
except ImportError:
package = ['pypng','pyqrcode']
for inst in package:
subprocess.check_call([sys.executable, "-m", "pip",
"install",inst])
os.system('cls')
time.sleep(1)
break
import pyqrcode
import png

while True:
def str(s):
global psswd
psswd = ''
lowera = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
'm', 'n', 'o', 'p', 'q','r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
uppera = [ ]
passwd = []
for i in lowera:
uppera.append(i.upper())
num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symb = ['@', '#', '$', '%', '=', ':', '?', '.', '/', '|', '~',
'>','>','*', '(', ')']
all = lowera + uppera + num + symb

rlow = random.choice(lowera)
rupp = random.choice(uppera)
rnum = random.choice(num)
rsymb = random.choice(symb)
rall = rlow + rupp + rnum + rsymb
for i in range(s - 3):
rall = random.choice(all) + rall
tp1 = array.array('u',rall)
random.shuffle(tp1)
for x in tp1:
psswd = psswd + x

6
print("password generated:", psswd)
print("saving password...")
global wr
usrnm = input("enter the username of the password: ")
wr = 'Password for '+usrnm + " " + psswd + ' created at ' +
time.ctime() +"\n"
def store():
f = open('created_passwd.txt', 'a')
f.write(wr)
f.close()

def checker():
f = open('created_passwd.txt', 'r+')
for y in f:
if psswd in y:
f.truncate(-1)
str()
f.close()
else:
return
store()
checker()
while True:
try:
a = int(input("enter the length of the password to be
generated: "))
if a < 6:
print("Password is weak. Try again.")
elif a > 22:
print("Password is too big. Try again.")
else:
str(a)
qn = input('Create a QR code for easy access? (y/n)')
qn.islower()
if qn == 'y':
qr = pyqrcode.create(wr)
qrnm = input("What should the QR code be named as? ")
+".png"
qr.png(qrnm, scale=6)
print("qrcode successfully saved")
break
elif qn == 'n':
print('okay')
break

else:
print('Error Try again')
except ValueError:
print("Enter numbers not alphabets ")
break
br = input("Generate an other password?(y/n)")
br.islower()
if br == 'y':
pass

elif br == 'n':
print('okay')
break

7
Program Output

8
Limitations

This code can only make passwords but it can not read it or view created
passwords.
The project can have attractive Graphical User Interface and many more user
friendly options in the future.

9
Bibliography
1. Computer Science with python for Class – 12 - Sumitha Aroa

2. Stackoverflow.com

3. https://www.w3schools.com/python

10
THANK YOU

11

You might also like