0% found this document useful (0 votes)
8 views16 pages

Class 12 Project CS

Uploaded by

pradhumankamble6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views16 pages

Class 12 Project CS

Uploaded by

pradhumankamble6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

PM SHRI KENDRIYA

VIDYALAYA No. 2 AFS, PUNE

COMPUTER SCIENCE PROJECT

PASSWORD MANAGEMENT SYSTEM

Subject: Computer Science (083)

Submitted by: Guided


by:
Shruti Chandravanshi Hari Shankar Rai
(PGT CS)
Class: 12th A
Roll no:

Academic Year: 2024 – 2025


ACKNOWLEDGEMENT

I would like to express my special thanks of


gratitude to our Bharat Bhushan, Principal, PM
SHRI K V No. 2, AFS, Pune and to my CS teacher
Hari Shankar Rai sir who gave me the golden
opportunity to do this wonderful project and
provided all necessary support to do the project on
the topic Password Management System which
also allowed me to do a lot of research and I came
to know about so many new things, I am really
thankful to them.

Secondly, I would also like to thank my parents and


friends who helped me a lot in completing this
project within the limited time frame.
Shruti Chandravanshi

CERTIFICATE

This to certify that Shruti Chandravanshi of class


12A has successfully completed his/her python
project on the topic ‘Password Management
system’ for the subject Computer Science (083)
as prescribed by CBSE, under the guidance of Hari
Shankar Rai, PGT CS, during the academic year
2024 -2025.

Internal Principal
External Examiner
Examiner
CONTENTS

Sr.no Topic Page


no.
1 Introduction 5
2 About the Project 6
3 Code 7
4 Output 10
5 Bibliography & 14
References
INTRODUCTION

The Password Management System is a Python


program designed to securely manage your
passwords. This tool helps you store, retrieve,
and manage passwords for various accounts.

The project features a simple GUI application


built using the Tkinter module, providing a user-
friendly interface. Users can add, retrieve, list,
and delete passwords with ease, ensuring they
never forget or misplace their credentials.

The project uses simple Python concepts and


structure formatting in order to make the code
more efficient and readable.
ABOUT THE PROJECT
The objective of this project is to enable students to apply their
programming skills to address real-world challenges, enhancing
their logical thinking and programming abilities throughout the
process.
This Python project provides a secure and efficient solution for
managing passwords, allowing users to store, retrieve, list, and
delete passwords with ease.

This Python program incorporates various concepts, including:


Modules
User-defined functions
Dictionaries
Lists
If, elif, else statements
File handling

Different data types such as strings and integers are manipulated


within this program.
We have applied various concepts from this module, such as
creating a GUI window screen, labels, and buttons.
The program starts with an elegant opening GUI screen,
welcoming the user and displaying options for different
functionalities. Users can add a new password by entering a
username and password, retrieve a password by entering the
username, list all stored passwords, or delete a specific password.
Each action is accompanied by informative message boxes that
provide feedback to the user.
By integrating these features, the Password Manager aims to
enhance online security and convenience, enabling users to
maintain strong, unique passwords for their accounts without the
hassle of remembering them all.

CODE
import tkinter as tk
from tkinter import messagebox

def add():
username = entryName.get()
password = entryPassword.get()
if username and password:
f = open("passwords.txt", 'a')
f.write(f"{username} {password}\n")
messagebox.showinfo("Success", "Password
added !!")
f.close()
else:
messagebox.showerror("Error", "Please enter
both the fields")

def get():
username = entryName.get()
passwords = {}
try:
f = open("passwords.txt", 'r')
data = f.readlines()
for k in data:
i = k.split()
if len(i) == 2:
passwords[i[0]] = i[1]
except EOFError:
print("ERROR !!")
if passwords:
for i in passwords:
if i == username:
mess = f"Password for {username} is
. {passwords[i]}\n"
break
else:
mess = "No Such Username Exists !!"
messagebox.showinfo("Passwords", mess)
else:
messagebox.showinfo("Passwords", "EMPTY
LIST!!")

def getlist():
passwords = {}
try:
with open("passwords.txt", 'r') as f:
data = f.readlines()
for k in data:
i = k.split()
if len(i) == 2:
passwords[i[0]] = i[1]
except EOFError:
print("No passwords found!!")
if passwords:
mess = "List of passwords:\n"
for name, password in passwords.items():
mess += f"Password for {name} is
{password}\n"
messagebox.showinfo("Passwords", mess)
else:
messagebox.showinfo("Passwords", "Empty
List !!")

def delete():
username = entryName.get()
temp_passwords = []
try:
with open("passwords.txt", 'r') as f:
data = f.readlines()
for k in data:
i = k.split()
if len(i) == 2 and i[0] != username:
temp_passwords.append(f"{i[0]}
{i[1]}")
with open("passwords.txt", 'w') as f:
for i in temp_passwords:
f.write(i+"\n")
if any(username == k.split()[0] for k in data
if len(k.split()) == 2):
messagebox.showinfo("Success", f"User
{username} deleted successfully!")
else:
messagebox.showinfo("Info", f"No user named
{username} was found.")
except Exception as e:
messagebox.showerror("Error", f"Error deleting
user {username}: {e}")

app = tk.Tk()
app.resizable(0,0)
app.geometry("600x300")
app.configure(bg='#aed6f1')
app.title("Password Management System")

center_frame = tk.Frame(app)
center_frame.place(relx=0.5, rely=0.5, anchor =
tk.CENTER)

entry = tk.Label(app, bg='#aed6f1', fg='#FFFFFF',


text='Welcome . to Password Management System!',
font=('Footlight MT . Light',16,'bold'))
entry.place(x=10, y=30, width=600, height=40)

labelName = tk.Label(center_frame, text="USERNAME:")


labelName.grid(row=0, column=0, padx=15, pady=15)
entryName = tk.Entry(center_frame)
entryName.grid(row=0, column=1, padx=15, pady=15)

labelPassword = tk.Label(center_frame,
text="PASSWORD:")
labelPassword.grid(row=1, column=0, padx=10, pady=5)
entryPassword = tk.Entry(center_frame)
entryPassword.grid(row=1, column=1, padx=10, pady=5)

buttonAdd = tk.Button(center_frame, text="Add",


command=add)
buttonAdd.grid(row=2, column=0, padx=15, pady=8,
sticky="we")

buttonGet = tk.Button(center_frame, text="Get",


command=get)
buttonGet.grid(row=2, column=1, padx=15, pady=8,
sticky="we")
buttonList = tk.Button(center_frame, text="List",
command=getlist)
buttonList.grid(row=3, column=0, padx=15, pady=8,
sticky="we")
buttonDelete = tk.Button(center_frame, text="Delete",
command=delete)
buttonDelete.grid(row=3, column=1, padx=15, pady=8,
sticky="we")

app.mainloop()

Output
Add:
List:
Get:

Delete:
BIBLIOGRAPHY & REFERENCES

Computer Science with Python by Sumita Arora

class 12th.

https://www.w3schools.com

https://www.geeksforgeeks.org

You might also like