Password Manager File
Password Manager File
PASSWORD MANAGER
SUBMITTED BY:
ANIRUDH ADITHYA B S
1
MATHAKONDAPALLI MODEL SCHOOL
BONAFIED CERTIFICATE
Of class XII in Mathakondapalli Model School, Hosur During the year 2019-2020.
2
ACKNOWLEDGEMENT
I register my sense of gratitude to Mathakondapalli Model School and our Principals for
the opportunity and facilities provided which helped me to complete this project successfully.
I am also thankful to our principal, our Co-coordinator for the help provided in referring the
required amount of resources.
Last but not least, I would like to thank my classmates for their timely help and support for
completion of this project
3
INDEX
01 INTRODUCTION 05
02 PROJECT DESCRIPTION 05
03 PROJECT REQUIREMENT 06
04 PYTHON CONCEPTS 07
05 PROGRAM 13
06 OUTPUT 28
07 CONCLUSION 29
08 BIBLIOGRAPHY 33
09 WEBSITES REFERED 34
4
INTRODUCTION
Basically Passwords are cumbersome and hard to remember and just when you did,
you’re told to update it again after some period of time. And sometimes passwords can be
guessed and are easily hackable. Can you make them better and easier? Yes, you need a
Password Manager.
A Password Manager is a simple Python application that is used to store and manage the
passwords that a user has for various online accounts and security features. Password Managers
store the passwords in MYSQL Database and provide secure access to all the password
information with the help of a master password. This helps in the prevention of hacker attacks
like keystroke logging and it prevents the need to remember multiple passwords.
1. This application providing the Best Secure Database connected with MYSQL server to
Store your Passwords and User Friendly to Access your Stored Password.
2. This application providing the Multi Accounts Facility.
3. Users can manage not only the Passwords they can even manage their Purchase Cards
Details and Bank Details.
4. It is providing the Offline and Free Database so, users can access their Passwords any
time without Internet.
5. This application provides Easy Backup option where users can easily save their
Passwords in Text File Directly and Copy to their Compact Devices.
DESCRIPTION
Password Manager is windows console based simple software developed with Python v3.2 that
allows you to easily add or update your Passwords of various Websites and other sources on
MYSQL Database.
5
Software testing is an investigation conducted to provide stakeholders with information
about the quality of the product or service under test. Software testing can also provide an
objective, independent view of the software to allow the business to appreciate and understand
the risks of software implementation.
Test techniques include the process of executing a program or application with the intent
of finding software bugs (errors or other defects), and to verify that the software product is fit for
use.
PROJECT REQUIREMENTS
SOFTWARE
● MYSQL SERVER
● OS SUPPORTED: WINDOWS (7, 8, 8.1, 10)
● System Architecture: 32 and 64
HARDWARE
6
PYHTON CONCEPS USED IN PROJECT
NUMBER: Number data type stores Numerical Values. This data type is immutable value of its
object cannot be changed. Numbers are of three different types
1. Integer & Long (to store whole numbers i.e. decimal digits without fraction part)
2. Float/floating point (to store numbers with fraction part)
3. Complex (to store real and imaginary part)
CONDITIONAL STATEMENTS:
SEQUENCE:
String:
String is an ordered sequence of letters/characters. They are enclosed in single quotes (' ') or
double quotes ('' "). The quotes are not part of string. They only tell the computer about where
the string constant begins and end, they can have any character or sign, including space in these
are immutable. A string with length 1 represents a character in python.
Lists:
List is also a sequence of values of any type. Values in the list are called
elements / items. These are mutable and indexed/ordered. List is enclosed in square brackets
([ ]).
7
Tuple: A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists.
The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples
use parentheses, whereas lists use square brackets. Eg: tup1 = ('python', 'password', 2019, 2020)
Operators are special symbols that represent computation like addition and
multiplication. The values that the operator is applied to be called operands. Operators when
applied on operands form an expression. Operators are categorized as Arithmetic, Relational,
Logical and Assignment. Following is the partial list of operators:
Mathematical/Arithmetic operators: +, -, *, /
Assignment Operator: =, +=
FUNCTION IN PYTHON:
8
LOOP:
WHILE LOOP:
In python, while loop is used to execute a block of statements repeatedly until a given a
condition is satisfied. And when the condition becomes false, the line immediately after the loop
in program is executed.
FOR LOOP:
For loops are used for sequential traversal. For example: traversing a list or string or array etc. In
Python, there is no C style for loop, i.e., for (i=0; i<n; i++). There is “for in” loop which is
similar to for each loop in other languages. Let us learn how to use for in loop for sequential
traversals.
CONDITIONS:
Conditions. Python uses Boolean variables to evaluate conditions. The Boolean values True and
False are returned when an expression is compared or evaluated.
IF:
In Python, If Statement is used for decision making. It will run the body of code only when IF
statement is true. When you want to justify one condition while the other condition is not true,
then you use "if statement".
ELIF:
It can be used after if statement in case you have one more comparison to made and one more
and one more and so on. If you have multiple elif then you can utilize dictionary data type
in python.
9
ELSE:
An else statement contains the block of code that executes if the conditional expression in the if
statement resolves to 0 or a FALSE value. The else statement is an optional statement and there
could be at most only one else statement following if.
EXCEPTIONAL HANDLING:
An exception is an event, which occurs during the execution of a program that disrupts
the normal flow of the program's instructions. In general, when a Python script encounters a
situation that it cannot cope with, it raises an exception. An exception is a Python object that
represents an error.
The try and except block in Python is used to catch and handle
exceptions. Python executes code following the try statement as a “normal” part of the program.
This exception error will crash the program if it is unhandled. The except clause determines how
your program responds to exceptions.
MODULES:
A module is a Python object with arbitrarily named attributes that you can bind and
reference. Simply, a module is a file consisting of Python code. A module can define functions,
classes and variables. A module can also include runnable code.
Modules Used:
10
5. os: It is Built In Module in python. It is used to make system commands in Python.
Database Connection
In this section of the tutorial, we will discuss the steps to connect the python application to the
database.
There are the following steps to connect a python application to our database.
To create a connection between the MySQL database and the python application, the connect()
method of mysql.connector module is used.
Pass the database details like Host Name, username, and the database password in the method
call. The method returns the connection object.
The cursor object can be defined as an abstraction specified in the Python DB-API 2.0. It
facilitates us to have multiple separate working environments through the same connection to the
11
database. We can create the cursor object by calling the 'cursor' function of the connection
object. The cursor object is an important aspect of executing queries to the databases.
1. <my_cur> = conn.cursor()
Closing connection
To close the connection in mysql database we use php function mysqli_close() which disconnect
from database. It require a parameter which is a connection returned by the mysql_connect
function.
Syntax:
mysql_close(conn);
12
PROGRAM
import os
import stdiomask
import datetime
import mysql.connector
try:
if cre_acc==1:
try:
connection=mysql.connector.connect(user="root",password=""+sql_pass+"",host="localhost",da
tabase=""+database+"")
mycur=connection.cursor()
mycur.execute(pass_db)
mycur.execute(check_pass)
13
data1=mycur.fetchall()
mycur.execute(ori_pass)
data=mycur.fetchall()
if data==data1:
break
else:
except mysql.connector.Error:
elif cre_acc==2:
try:
try:
connection=mysql.connector.connect(user="root",password=""+sql_pass+"",host="localhost",da
tabase=""+database+"")
continue
14
except mysql.connector.Error:
connection=mysql.connector.connect(user="root",password=""+sql_pass+"",host="localhost",da
tabase=""+database+"")
mycur=connection.cursor()
mycur.execute(pass_db)
connection.commit()
15
print("Thank You for Choosing Password Manager\nYour Account for Password
Manager has been Created Sucessfully :) ")
except mysql.connector.Error:
input("Warning!! Please Don't use Special Character \nPress Any Key to Continue")
else:
except ValueError:
#######MAIN MENU#########
while True:
os.system("cls")
print("Main Menu")
print("\n1.Account Settings")
print("6.Help Desk")
16
print("7.Exit")
try:
#Main
#Main Choice1
if user_choice==1:
pre_check=mycur.fetchall()
pre_check_data=len(pre_check)
if pre_check_data==0:
print("\n#######################################################################
#")
print("\n#######################################################################
#")
else:
mycur.execute(check_pass)
data1=mycur.fetchall()
mycur.execute(ori_pass)
data=mycur.fetchall()
if data==data1:
while True:
os.system("cls")
print("Settings\n")
print("4.Back")
try:
if set_choice==1:
18
new_pass=stdiomask.getpass(prompt='Enter your New Password: ',
mask='*')
connection.commit()
elif set_choice==2:
time=datetime.datetime.now()
social_media_data=mycur.fetchall()
19
mycur.execute("select bname, username, password, transaction_password,
register_mobile, notes from inter_banking")
inter_bank_data=mycur.fetchall()
inter_data=((tabulate(inter_bank_data, headers=["Bank
Name","Username","Password","Transaction Password","Mobile Number","Notes"],
tablefmt="psql")))
bank_data=mycur.fetchall()
card_data=mycur.fetchall()
test_data.write("=========================================================
===================TABLE============================================
=======================\n")
20
test_data.writelines(table)
test_data.writelines("\n====================================================
==========SOCIAL MEDIA
ACCOUNTS===========================================================
======\n")
test_data.writelines(social_data)
test_data.writelines("\n====================================================
========INTERNET BANKING
ACCOUNTS===========================================================
====\n")
test_data.writelines(inter_data)
test_data.writelines("\n====================================================
==============BANK
DETAILS=============================================================
=========\n")
test_data.writelines(bank_details)
test_data.writelines("\n====================================================
===============SAVED
CARDS===============================================================
=======\n")
test_data.writelines(save_cards)
test_data.close()
21
print("Backuped your Datas to Text File ('Password Manager
Backup"+time.strftime("%d %B %Y")+".txt') Sucessfully,")
print("creating tables")
22
branch_name varchar(30), register_mobile varchar(30), register_email varchar(30),
customer_number varchar(30), cif_number varchar(30), notes varchar(30))")
print("Reseted Sucessfully")
elif set_choice==3:
connection1=mysql.connector.connect(user="root",password=""+sql_pass+"",host="localhost")
mycur1=connection1.cursor()
quit()
elif set_choice==4:
break
else:
except ValueError:
23
input("Invalid Option, Enter only Integers\n Press Any Key to Continue")
else:
print("Sorry!!Access Denied")
connection.commit()
#connection.close()
elif user_choice==2:
pre_check=mycur.fetchall()
pre_check_data=len(pre_check)
if pre_check_data==0:
print("\n#######################################################################
#")
print("\n#######################################################################
#")
else:
24
password=stdiomask.getpass(prompt='Enter the Password: ', mask='*')
mycur.execute(pass_db)
mycur.execute(check_pass)
data1=mycur.fetchall()
mycur.execute(ori_pass)
data=mycur.fetchall()
if data==data1:
#After Log In
while True:
os.system("cls")
25
print("5.Back")
try:
##SUBCHOICE1
if add_choice==1:
while True:
os.system("cls")
try:
print("########################################################################
")
for i in range(repeat):
row_no=mycur.fetchall()
sno=len(row_no)+1
26
snotes=input("You can add Aditional Information if any (optional): ")
print("########################################################################
")
##SQl CONNECTION##
mycur.execute(add_social)
connection.commit()
#connection.close()
rint("########################################################################")
break
except ValueError:
27
OUTPUT
2. Welcome Page
28
3. When User Selects “Register” for Create an Account
29
5. Main Menu of the Program
30
8.When User Selects “Add your Passwords and Datas” in Main Menu
31
11. When User Selects “View” and Selects “Social Media Accounts”
12. When User Selects “Save Datas to Text File” in Main Menu
32
CONCLUSION
This project “Password Manager” was done for using it in our school for helping to know more
about programming language. In the process of completing this project I was able to learn many
new concepts in python programming language and I also gained knowledge and experience on
how a program works practically and what type of errors arises and how to clear the errors.
Learning python and doing program first time was not a simple thing for me. But I sincerely
thank MR. NAGARAJ who helped me through the project and clarified the doubt asked.
THANK YOU
33
BIBILIOGRAPHY
BOOKS REFERED:
WEBSITES REFERED:
https://stackoverflow.com/
https://www.geeksforgeeks.org/python-programming-language/
34