You are on page 1of 31

CHENNAI – 600066

AISSCE – 2021

COMPUTER SCIENCE PROJECT ON

PASSWORD MANAGEMENT SYSTEM

DEPARTMENT OF COMPUTER SCIENCE

2021-2022
VELAMMALVIDHYASHRAM

COMPUTER SCIENCEPROJECT

CERTIFICATE

This is to certify that this is the bonafide record of project


work done by Master/Miss. Tejeswaran M of Grade XII
during the academic year 2021-2022.

Submitted for AISSCE Computer Science Practical


examination held on at Velammal
Vidhyashram, Chennai-66.

Date:

PRINCIPAL INTERNALEXAMINER EXTERNALEXAMINER

[2]
Acknowledgements

We would like to thank Smt. Chitra Madhavan, Principal Bharathi wing


Velammal vidhyashram surapet.
We are deeply indebted to our mentor Smt. Kavitha. K.

We further thank to all the staff members of Velammalvidhyashramsurapet.


Our heartfelt thanks to CBSE.

We also express our deepest gratitude to our parents.

Finally, we would like to wind up by paying our heartfelt thanks to all our
near and dearones.

[3]
TABLE OF CONTENT:

PAGE
S.NO CONTENTS NO.

1. ABSTRACT 5

2. SYSTEM CONFIGURATION 6

3. INTRODUCTION
7
 PYTHON
 MYSQL

RELATION BETWEEN PYTHON AND MYSQL


4. 12

5. DATABASE CONNECTIVITY 13

6. LIBRARIES AND FUNCTIONS USED 14

7. MYSQL QUERIES USED IN THIS PROJECT 15

8. SOURCE CODE 16

9. OUTPUT(SCREENSHOT) 27

10. CONCLUSION 28

11. BIBILOGRAPHY 29

[4]
ABSTRACT:
Password Management System project is developed using Python and MySQL Database. This is a
simple project which helps user in managing their password in a easy and encrypted way. The main aim
of this project is to manage password for different accounts. Password Management system project in
Python is a simple console application. In this project, users can perform certain functions like add, view
and delete.

  WHAT IS PASSWORD MANAGEMENT SYSTEM:

"PASSWORD MANAGEMENT SYSTEM" This project is to manage passwords for different


accounts on the internet. The user shall be able to save all the username and passwords information of
the accounts he holds on the internet using this system. These details shall be saved in the database
in encrypted format. This will help the user to remember different usernames and passwords for
accounts on the internet. The user shall be able to add account, edit and delete account using the
system. . All the details related to the account like the user name, password, account type, etc shall be
stored.

[5]
SYSTEM CONFIGURATION:

HARDWARE CONFIGURATION
Microsoft windows 7 professional/windows 8/windows 8.2:
 Processor : Intel Core i3 orequivalent
 Memory : 2 GB (32-bit), 4 GB(64-bit)
 Disk space : 1.5 GB of free diskspace

SOFTWARE REQUIREMENTS
 1 GB RAM (2 GB+recommended)
 9-58 GB free hard disk space depending on edition and configuration,
including space required for temporaryfiles
 DVD-ROM drive (if installing from a Media KitDVD)
 Basic GPU – Any vendor DirectX 9.0 class or better (Pixel Shader Level2)
 Intel® Pentium® or compatible, 1.6 GHz minimum
(2GHz+recommended)
 1024x768 or higher-resolutionmonitor
 MOUSE OR OTHER POINTINGDEVICE

[6]
INTRODUCTION:
PYTHON:

Python is a high-level, interpreted scripting language developed in the late 1980s by Guido van Rossum at
the National Research Institute for Mathematics and Computer Science in the Netherlands. The initial
version was published at the alt. sources newsgroup in 1991, and version 1.0 was released in 1994.

Python 2.0 was released in 2000, and the 2.x versions were the prevalent releases until December 2008.
At that time, the development team made the decision to release version 3.0, which contained a few
relatively small but significant changes that were not backward compatible with the 2.x versions. Python 2
and 3 are very similar, and some features of Python 3 have been backported to Python 2. But in general,
they remain not quite compatible.

Both Python 2 and 3 have continued to be maintained and developed, with periodic release updates for
both. As of this writing, the most recent versions available are 2.7.15 and 3.6.5. However, an official End
of life of January 1,2020 has been established for Python 2, after which time it will no longer be
maintained. If you are a newcomer to Python, it is recommended that you focus on Python 3, as this
tutorial will do.

Python is still maintained by a core development team at the Institute, and Guido is still in charge, having
been given the title of BDFL (Benevolent Dictator For Life) by the Python community. The name Python,
by the way, derives not from the snake, but from the British comedy troupe Monty Python’s Flying
Circus, of which Guido was, and presumably still is, a fan. It is common to find references to Monty
Python sketches and movies scattered throughout the Python documentation.

Python is Popular

Python has been growing in popularity over the last few years. The 2018 Stack Overflow Developer
Survey ranked Python as the 7th most popular and the number one most wanted technology of the year.
World-class software development countries around the globe use Python every single day. According to
research by Dice Python is also one of the hottest skills to have and the most popular programming
language in the world based on the Popularity of programming Language Index.

[7]
Python is interpreted

Many languages are compiled, meaning the source code you create needs to be translated into machine
code, the language of your computer’s processor, before it can be run. Programs written in an interpreted
language are passed straight to an interpreter that runs them directly.

This makes for a quicker development cycle because you just type in your code and run it, without the
intermediate compilation step.

One potential downside to interpreted languages is execution speed. Programs that are compiled into the
native language of the computer processor tend to run more quickly than interpreted programs. For some
applications that are particularly computationally intensive, like graphics processing or intense number
crunching, this can be limiting.

In practice, however, for most programs, the difference in execution speed is measured in milliseconds, or
seconds at most, and not appreciably noticeable to a human user. The expediency of coding in an
interpreted language is typically worth it for most applications.

Python is Free

The Python interpreter is developed under an OSI-approved open-source license, making it free to install,
use, and distribute, even for commercial purposes.

A version of the interpreter is available for virtually any platform there is, including all flavors of Unix,
Windows, mac OS, smartphones and tablets, and probably anything else you ever heard of. A version
even exists for the half dozen people remaining who use OS/2.

[8]
Python is Portable

Because Python code is interpreted and not compiled into native machine instructions, code
written for one platform will work on any other platform that has the Python interpreter installed.
(This is true of any interpreted language, not just Python.)

Python is Simple

As programming languages go, Python is relatively uncluttered, and the developers have
deliberately kept it that way. A rough estimate of the complexity of a language can be gleaned
from the number of keywords or reserved words in the language. These are words that are reserved
[9]
for special meaning by the compiler or interpreter because they designate specific built-in
functionality of the language. Python 3 has 33 keywords, and Python 2 has 31. By contrast, C++
has 62, Java has 53, and Visual Basic has more than 120, though these latter examples probably
vary somewhat by implementation or dialect.

MYSQL:
Database Management System & Types of DBMS:

A Database Management System(DBMS) is a software application that interacts with the user,
applications and the database itself to capture and analyze data. The data stored in the database can be
modified, retrieved and deleted, and can be of any type like strings, numbers, images etc.

Types of DBMS:
There are mainly 4 types of DBMS, which are Hierarchical, Relational, Network, and Object-
Oriented DBMS.

Hierarchical DBMS: As the name suggests, this type of DBMS has a style of predecessor- successor
type of relationship. So, it has a structure similar to that of a tree, wherein the nodes represent records and
the branches of the tree represent fields.

Relational DBMS (RDBMS): This type of DBMS, uses a structure that allows the users to identify and
access data in relation to another piece of data in the database.

Network DBMS: This type of DBMS supports many to many relations wherein multiple member records
can be linked.
Object-oriented DBMS: This type of DBMS uses small individual software called objects. Each object
contains a piece of data, and the instructions for the actions to be done with thedata.

Structured Query Language (SQL)

SQL is the core of a relational database which is used for accessing and managing the database. By using
SQL, you can add, update or delete rows of data, retrieve subsets of information, modify databases and
perform many actions. The different subsets of SQL are as follows:
[10]
 DDL (Data Definition Language) –It allows you to perform various operations on the database
such as CREATE, ALTER and DELETE objects.
 DML (Data Manipulation Language)– It allows you to access and manipulate data. It helps you to
insert, update, delete and retrieve data from the database.

 DCL (Data Control Language)– It allows you to control access to the


database. Example – Grant or Revoke accesspermissions.
 TCL(Transaction Control Language) – It allows you to deal with the transaction of the database.
Example – Commit, Rollback, Save point, Set Transaction.

MySQL & its Features


MySQL is an open-source relational database management system that works on many platforms. It
provides multi-user access to support many storage engines and is backed by Oracle. So, you can buy a
commercial license version from Oracle to get premium support services.

The features of MySQL are as follows:

Ease of Management –The software very easily gets downloaded and also uses an event scheduler to
schedule the tasks automatically.

 Robust Transactional Support –Holds the ACID (Atomicity, Consistency, Isolation, Durability)
property, and also allows distributed multi-versionsupport.
 Comprehensive Application Development –MySQL has plugin libraries to embed the database
into any application. It also supports stored procedures, triggers, functions, views and many more
for application development. You can refer to the RDS Tutorial, to understand
Amazon’sRDBMS.
 High Performance –Provides fast load utilities with distinct memory caches and table
indexpartitioning.
 Low Total Cost Of Ownership –This reduces licensing costs and hardware expenditures.

 Open Source & 24 * 7 Support –This RDBMS can be used on any platform and offers 24*7
support for open source and enterpriseedition.
 Secure Data Protection –MySQL supports powerful mechanisms to ensure that only authorized
[11]
users have access to thedatabases.
 High Availability –MySQL can run high-speed master/slave replication
configurations and it offers clusterservers.
 Scalability & Flexibility –With MySQL you can run deeply embedded applications and create
data warehouses holding a humongous amount of data.

[12]
MySQL Data Types
 Numeric – This data type includes integers of various sizes, floating-point(real) of various
precisions and formattednumbers.
 Character-string – These data types either have a fixed, or a varying number of characters. This
data type also has a variable-length string called CHARACTER LARGE OBJECT(CLOB) which is
used to specify columns that have large text values.
 Bit-string – These data types are either of a fixed length or varying length of bits. There is also a
variable-length bit string data type called BINARY LARGE OBJECT(BLOB), which is available to
specify columns that have large binary values, such asimages.
 Boolean –This data type has TRUE or FALSE values. Since SQL, has NULL values, a three-
valued logic is used, which isUNKNOWN.
 Date & Time –The DATE data type has: YEAR, MONTH, and DAY in the form YYYY-MM-
DD. Similarly, the TIME data type has the components HOUR, MINUTE, and SECOND in the
form HH:MM: SS. These formats can change based on therequirement.
 Timestamp & Interval –The TIMESTAMP data type includes a minimum of six positions, for
decimal fractions of seconds and an optional WITH TIME ZONE qualifier in addition to the
DATE and TIME fields. The INTERVAL data type mentions a relative value that can be used to
increment or decrement an absolute value of a date, time, ortimestamp.

Python MySQL DatabaseConnection:

Arguments required to connect MySQL from Python


You need to know the following detail of the MySQL server to perform the connection from Python.

 Username – i.e., the username that you use to work with MySQL Server. The default
username for the MySQL database is a root

 Password – Password is given by the user at the time of installing the MySQL database. If
you are using root then you won’t need thepassword.

 Host Name – is the server name or Ip address on which MySQL is running. if you are running
on localhost, then you can use localhost, or it’s IP, i.e.127.0.0.0

 Database Name – Database name to which you want to connect.

[13]
READ Operation
READ Operation on any database means to fetch some useful information from the database.
Once our database connection is established, you are ready to make a query into this database. You can
use either fetchone() method to fetch single record or fetchall() method to fetech multiple values from a
database table.

 fetchone() − It fetches the next row of a query result set. A result set is an object that is returned
when a cursor object is used to query atable.

 fetchall() − It fetches all the rows in a result set. If some rows have already been extracted from
the result set, then it retrieves the remaining rows from the result set.

DATABASE CONNECTIVITY:

Steps to connect MySQL database in Python using MySQL Connector


Python

1. Install MySQL Connector Python usingpip.

2. Use the mysql.connector.connect() method of MySQL Connector Python with required


parameters to connectMySQL.

3. Use the connection object returned by a connect()method to create a cursor object to perform
Database Operations.

4. The cursor.execute() to execute SQL queries fromPython.

5. Close the Cursor object using a cursor.close() and MySQL database connection using
connection.close() after your work completes.

6. Catch Exception if any that may occur during this process

[14]
LIBRARIES AND FUNCTIONS USED:

1. mysqlconnector - MySQL Connector/Python enables Python programs to access MySQL


databases, using an API that is compliant with the Python Database API Specification v2.0 (PEP
249). It is written in pure Python and does not have any dependencies except for the Python
Standard Library.

2. Cryptography - Cryptography package that helps us encrypt and decrypt data. The fernet module of
the cryptography package has inbuilt functions for the generation of the key, encryption of plaintext
into ciphertext, and decryption of ciphertext into plaintext using the encrypt and decrypt methods
respectively. The fernet module guarantees that data encrypted using it cannot be further manipulated
or read without the key.

FUNCTIONS USED: WRITE IN DEATAIL ABOUT PURPOSE OF THE


FUNCTION.

1.  Add_Account ( )        - Using these function we can add the account details

2. Add_password( ) -  Using these function we can add the password

3. Edit_details( )   -   Using these function we can edit the account details

4. Remove_password() - This function is used to remove the password

5. Password() -  Using this function we can convert the characters given by the user into
a encrypted sequence

6. View_account() -  Using these function we can view the account details

7. Delete_Account( ) -  Using these function we can delete the account detail

[15]
MYSQL QUERIES USED IN THIS PROJECT:

1. mycursor.execute(‘ ‘ ‘

CREATE TABLE USERS (

USER VARCHAR(17) UNIQUE,

PASSWORD VARCHAR(17))

‘ ‘ ‘)

2. mycursor.execute(‘ ‘ ‘

CREATE TABLE PASSWORDS_DATA (

USER VARCHAR(17),

NAME VARCHAR(17),

PASSWORD VARCHAR(17),

NOTES VARCHAR(100))

‘ ‘ ‘)

[16]
SOURCE CODE

#MAIN
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import db

class MainApplication:

def __init__(self, master):


# the login window design
self.large_font = ('Verdana', 25)
self.small_font = ('Verdana', 10)
self.user = tk.StringVar()
self.password = tk.StringVar()

self.master = master
self.master.title("Password Storage")
self.master.resizable(False, False)

self.loginLabel = tk.Label(self.master,
text="**Login**", width=3, height=2, font=self.large_font)
self.loginLabel.grid(row=0, column=1,
sticky=tk.W+tk.E+tk.N+tk.S , padx=10, pady=5)

self.userLabel = tk.Label(self.master, text="User:",


width=3, height=3, font=self.large_font)
self.userLabel.grid(row=1, column=1,
sticky=tk.W+tk.E+tk.N+tk.S, padx=10, pady=5)

self.userEntry = tk.Entry(self.master,
textvariable=self.user, font=self.large_font)
self.userEntry.grid(row=2, column=0, padx=10,
pady=5, columnspan=3)
self.userEntry.config(fg="black", justify="left")
[17]
self.passwordLabel = tk.Label(self.master,
text="Password:", width=3, height=3,
font=self.large_font)
self.passwordLabel.grid(row=3, column=1,
sticky=tk.W+tk.E+tk.N+tk.S, padx=10, pady=5)

self.passwordEntry = tk.Entry(self.master,
textvariable=self.password, font=self.large_font)
self.passwordEntry.grid(row=4, column=0, padx=10,
pady=5, columnspan=3)
self.passwordEntry.config(show="*", justify="left")

self.bottonLog = tk.Button(self.master,
text="Entrar", width=40, height=3, cursor="hand2",
font=self.small_font, command=lambda:self.log_in())
self.bottonLog.grid(row=5, column=1, padx=10,
pady=11)

self.user.trace("w", lambda *args:


self.character_limit(self.user))
self.password.trace("w", lambda *args:
self.character_limit(self.password))

def log_in(self):
"""Verify the account, if it does not exist, ask to
create a new"""

value = db.loginUser(self.user.get(),
self.password.get())
if value == "yes":
self.password = ""
self.passwordStorageWindow()
elif value == "no":
messagebox.showwarning("Incorrect Password",
"You typed a wrong password")
elif value == "error":
answer = messagebox.askquestion("Unregistered
User", "Do you want to create a new one?")
[18]
if answer == "yes":
db.createUser(self.user.get(),
self.password.get())
self.password = ""
self.passwordStorageWindow()

def passwordStorageWindow(self):
# The storage window design
self.newNameList = tk.StringVar()
self.newPasswordList = tk.StringVar()

self.master.withdraw()
self.passwordsScreen = tk.Toplevel(self.master)
self.passwordsScreen.resizable(False, False)
self.frame1 = tk.Frame(self.passwordsScreen)
self.frame1.pack()
self.frame2 = tk.Frame(self.passwordsScreen)
self.frame2.pack()

self.addPasswordLabel = tk.Label(self.frame1,
text="Add New Password", font=self.large_font)
self.addPasswordLabel.grid(row=0, column=1,
sticky=tk.W+tk.E+tk.N+tk.S)

self.nameLabel = tk.Label(self.frame1,
text="Name:", font=self.large_font)
self.nameLabel.grid(row=1, column=0, sticky=tk.E)

self.nameEntry = tk.Entry(self.frame1,
font=self.large_font, textvariable=self.newNameList)
self.nameEntry.grid(row=1, column=1)
self.nameEntry.config(fg="black", justify="left")

self.passwordLabel = tk.Label(self.frame1,
text="Password:", font=self.large_font)
self.passwordLabel.grid(row=2, column=0,
sticky=tk.E, pady=5)

[19]
self.passwordEntry = tk.Entry(self.frame1,
font=self.large_font, textvariable=self.newPasswordList)
self.passwordEntry.grid(row=2, column=1)
self.passwordEntry.config(fg="black", justify="left")

self.noteLabel = tk.Label(self.frame1, text="Notes:",


font=self.large_font)
self.noteLabel.grid(row=3, column=0,
sticky=tk.N+tk.E)

self.noteText =
tk.Text(self.frame1,width=20,height=3,
font=self.large_font)
self.noteText.grid(row=3, column=1)
self.scrollVertNoteText = tk.Scrollbar(self.frame1,
command=self.noteText.yview)
self.scrollVertNoteText.grid(row=3, column=2,
sticky="nsew")

self.noteText.config(yscrollcommand=self.scrollVertNot
eText.set)

self.savePasswordButton = tk.Button(self.frame1,
text="Save New Password", width=20, height=3,
cursor="hand2", font=('Arial', 13), command=lambda:
self.insertNewPassword())
self.savePasswordButton.grid(row=4, column=1)

self.label = tk.Label(self.frame2, text="Passwords


List", font=("Arial", 30)).grid(row=0, columnspan=3)

self.cols = ('Password', 'Notes')

self.style = ttk.Style()
self.style.configure("mystyle.Treeview.Heading",
font=('Calibri', 13, 'bold'))

self.passwordsList = ttk.Treeview(self.frame2,
columns=self.cols, style="mystyle.Treeview")
[20]
self.passwordsList.grid(row=1, column=0,
columnspan=2)
self.scrollVertPasswordsList =
tk.Scrollbar(self.frame2,
command=self.passwordsList.yview)
self.scrollVertPasswordsList.grid(row=1, column=3,
sticky="nsew")

self.passwordsList.config(yscrollcommand=self.scrollVe
rtPasswordsList.set)

self.passwordsList.heading("#0", text="Name")
self.passwordsList.column("#0", width=150)
self.passwordsList.heading("Password",
text="Password")
self.passwordsList.column("Password", width=150)
self.passwordsList.heading("Notes", text="Notes")
self.passwordsList.column("Notes", width=300)
self.passwordsList.grid(row=1, column=0,
columnspan=2, pady=5, padx=5)

self.passwordsList.bind("<Double-1>",
self.readNotes)
self.passwordsList.bind("<BackSpace>",
self.deleterow)
self.passwordsList.bind("<Delete>", self.deleterow)

self.newNameList.trace("w", lambda *args:


self.character_limit(self.newNameList))
self.newPasswordList.trace("w", lambda *args:
self.character_limit(self.newPasswordList))

self.passwordsScreen.protocol("WM_DELETE_WINDOW
", self.on_closing)

self.passwordTabler()

[21]
def character_limit(self, entry_text):
"""limit the length of a StringVar to 16"""
value = entry_text.get()
if len(value) > 16:
entry_text.set(value[:16])

def readNotes(self, event):


""" Create a extra notes window after double
clicking the password"""
name =
self.passwordsList.item(self.passwordsList.selection(),
"text")
notes = db.readNotes(self.user.get(), name)

if not notes:
pass
else:
self.notesScreen =
tk.Toplevel(self.passwordsScreen)
self.notesScreen.title("Notes")
self.notesScreen.resizable(False, False)
self.label = tk.Label(self.notesScreen,
text=notes[0][0], font=("Arial", 30)).grid(row=0,
columnspan=3)

def deleterow(self, event):


"""Delete a password after press the backspace key
or delete key from the keyboard"""
name =
self.passwordsList.item(self.passwordsList.selection(),
"text")
row_selected = self.passwordsList.selection()

answer = messagebox.askquestion("Delete
Password", "Are you sure you want to delete "+name+"
password?")
if answer == "yes":
db.deletePassword(self.user.get(), name)
[22]
self.passwordsList.delete(row_selected)

def passwordTabler(self):
# Create the table where the passwords are
self.tempList = db.readPasswords(self.user.get())

for i, (name, password, notes) in


enumerate(self.tempList, start=1):
decoded_pass =
db.cipher_suite.decrypt(password)
decoded_pass = decoded_pass.decode("utf-8")
self.passwordsList.insert("", "end", text=name,
values=(decoded_pass, notes.partition('\n')[0]))

def insertNewPassword(self):
# Add new password to the storage
if self.newPasswordList.get().isspace() or
self.newPasswordList.get() == "" or
self.newNameList.get().isspace() or
self.newNameList.get() == "":
messagebox.showwarning("Warning!", "Name
and Password cannot be empty")
else:
db.insertPasswordData(self.user.get(),
self.newNameList.get(), self.newPasswordList.get(),
self.noteText.get("1.0", tk.END))
self.newNameList.set("")
self.newPasswordList.set("")
self.noteText.delete(1.0, tk.END)
messagebox.showinfo("Congratulations!", "New
password added successfully!")

self.passwordsList.delete(*self.passwordsList.get_childr
en())
self.passwordTabler()

def on_closing(self):
# Stop the procces

[23]
if messagebox.askokcancel("Quit", "Do you want to
quit?"):
root.destroy()

if __name__ == "__main__":
db.createDB()
root = tk.Tk()
app = MainApplication(root)
root.mainloop()
#DB
import sqlite3
from cryptography.fernet import Fernet

key =
"Be1PA8snHgb1DS6oaWek62WLE9nxipFw3o3vB4uJ8ZI
=" # "secret key" This must be kept secret
cipher_suite = Fernet(key) # This class provides both
encryption and decryption facilities.

def conectionDB(func):
"""This is a decorator to open and close the
database"""
def wrapper(*args, **kwargs):
global myConection
global myCursor
myConection = sqlite3.connect("PasswordsDB")
myCursor = myConection.cursor()

result = func(*args, **kwargs)

myConection.commit()
myConection.close()

return result
return wrapper

[24]
@conectionDB
def createDB():
"""This is a function to create the database if is not
yet created"""
try:
myCursor.execute('''
CREATE TABLE USERS (
USER VARCHAR(17) UNIQUE,
PASSWORD VARCHAR(17))
''')

myCursor.execute('''
CREATE TABLE PASSWORDS_DATA (
USER VARCHAR(17),
NAME VARCHAR (17),
PASSWORD VARCHAR(17),
NOTES VARCHAR(100))
''')

except sqlite3.OperationalError:
pass

@conectionDB
def loginUser(user, password):
""" Function to login
@Return: "yes" if the password is correct, "no" if it
is incorrect, "error" if it does not exist"""
myCursor.execute("SELECT PASSWORD FROM
USERS WHERE USER='"+user+"'")
passwordDB = myCursor.fetchall()

try:
passwordDB = cipher_suite.decrypt(passwordDB[0]
[0])
passwordDB = passwordDB.decode("utf-8")
if passwordDB == password:
[25]
return "yes"
else:
return "no"

except IndexError:
return "error"

@conectionDB
def createUser(user, password):
"""Function to create new user"""
password = cipher_suite.encrypt(bytes(password,
encoding='utf-8'))
data = (user, password)
myCursor.execute("INSERT INTO USERS
VALUES(?,?)", data)

@conectionDB
def insertPasswordData(user, name, password, notes):
"""Function to save new password in the storage"""
password = cipher_suite.encrypt(bytes(password,
encoding='utf-8'))
data = (user, name, password, notes)
myCursor.execute("INSERT INTO
PASSWORDS_DATA VALUES(?,?,?,?)", data)

@conectionDB
def readPasswords(user):
""" Read all passwords from the user storage
@return: A list, in each row there is a password with
its corresponding name and notes"""
myCursor.execute("SELECT
NAME,PASSWORD,NOTES FROM PASSWORDS_DATA
WHERE USER='"+user+"'")
passwords = myCursor.fetchall()
return passwords
[26]
@conectionDB
def deletePassword(user, name):
""" Delete a password from the user storage
@param: the user and the name associated with the
password"""
myCursor.execute("DELETE FROM
PASSWORDS_DATA WHERE USER='"+user+"' AND
NAME='"+name+"'")

@conectionDB
def readNotes(user, name):
""" Read a password notes
@param: the user and the name associated with the
password"""
myCursor.execute("SELECT NOTES FROM
PASSWORDS_DATA WHERE USER='"+user+"' AND
NAME='"+name+"'")
notes = myCursor.fetchall()

return notes

[27]
OUTPUT

[28]
CONCLUSION

 Password Management software is designed to track and record the

[29]
account details of the user.
 It has all the modules that help user to maintain all the account details like
managing        
 Username, passwords, account type, and all other required information for the
account.
 overall it is specially designed to maintain all the account details of user.  
 This computerized system store all the data in the database which makes it easy to
fetch and update whenever needed.

BIBLIOGRAPHY
[30]
BOOKS AUTHORS

 Computer science with python - Sumitha Arora

References

1. python.org

2. CodeAcademy

3. tutorialsPoint.com

4. PythonChallenge.com

5. Google’s PythonClass

6. LearnPython.org

[31]

You might also like