From acd152827bcc34f8836bec6945dcadfd0dc76a3e Mon Sep 17 00:00:00 2001 From: LTxYan Date: Fri, 16 May 2025 12:00:00 +0100 Subject: [PATCH] Bryan's PASSWORDMANAGE --- PASSWORDMANAGE/README.md | 120 ++++++++++++ .../__pycache__/db_operations.cpython-312.pyc | Bin 0 -> 5283 bytes PASSWORDMANAGE/db_operations.py | 96 +++++++++ PASSWORDMANAGE/password manager.py | 182 ++++++++++++++++++ PASSWORDMANAGE/password_records.db | Bin 0 -> 12288 bytes PASSWORDMANAGE/secret.key | 1 + 6 files changed, 399 insertions(+) create mode 100644 PASSWORDMANAGE/README.md create mode 100644 PASSWORDMANAGE/__pycache__/db_operations.cpython-312.pyc create mode 100644 PASSWORDMANAGE/db_operations.py create mode 100644 PASSWORDMANAGE/password manager.py create mode 100644 PASSWORDMANAGE/password_records.db create mode 100644 PASSWORDMANAGE/secret.key diff --git a/PASSWORDMANAGE/README.md b/PASSWORDMANAGE/README.md new file mode 100644 index 0000000..079fd97 --- /dev/null +++ b/PASSWORDMANAGE/README.md @@ -0,0 +1,120 @@ + +# ๐Ÿ” Password Manager + +A secure desktop application to store and manage website credentials. It provides an intuitive UI, encrypted password storage, and basic CRUD functionality using SQLite and Python. + +--- + +## ๐Ÿ“Œ Features + +### โœ… Core Functionality +- **Master Password Login**: Access is protected with a configurable master password. +- **Add Records**: Securely add website credentials (website, username, password). +- **View Records**: Display all saved records in a sortable Treeview. +- **Update/Delete Records**: Modify or remove existing entries. +- **Copy Password**: Quickly copy passwords to clipboard with one click. +- **Encrypted Passwords**: Passwords are stored securely using `cryptography.Fernet`. +- **Masked Input**: Password entry fields are hidden by default. +- **Popup Notifications**: Temporary feedback for successful operations or errors. + +--- + +## ๐Ÿ“ Project Structure + +```plaintext +โ”œโ”€โ”€ password manager.py # Main GUI application +โ”œโ”€โ”€ db_operations.py # Handles database and encryption logic +โ”œโ”€โ”€ secret.key # Auto-generated key for encrypting passwords +โ”œโ”€โ”€ password_records.db # Local SQLite database (auto-created) +``` + +--- + +## ๐Ÿ”’ Security & Encryption + +- Uses `cryptography.Fernet` for symmetric encryption (AES). +- A unique encryption key is generated and stored in `secret.key`. +- Only the password field is encrypted in the database. +- `secret.key` is critical; if lost, encrypted passwords become unrecoverable. + +--- + +## ๐Ÿ›  Setup Instructions + +### ๐Ÿ“ฆ Requirements +- Python 3.7 or higher +- Required Python packages: + ```bash + pip install cryptography + ``` + +### โ–ถ How to Run +```bash +python "password manager.py" +``` + +--- + +## ๐Ÿ” Master Password + +The master password is **hardcoded** in the application for demonstration purposes. + +- The default master password is: + ``` + admin123 + ``` +- **To change** the master password, edit the following line in `password manager.py`: + ```python + if entered_password == "admin123": + ``` + +--- + +## ๐Ÿšง Planned Enhancements + +- [ ] Implement search functionality for website/username +- [ ] Add master password change feature +- [ ] Include password strength meter +- [ ] Integrate a password generator +- [ ] Export/import database with encryption +- [ ] Toggle password visibility in entry field + +--- + +## ๐Ÿงช Testing + +You can test the current features by: +1. Running the application +2. Logging in using the master password (`admin123`) +3. Adding new records and verifying encryption by checking the `password_records.db` +4. Testing copy password and update/delete functionality + +--- + +## ๐Ÿง  Usage Tips + +- To reset encryption (for testing), delete the `secret.key` and `password_records.db` files. + โš  **This will erase all stored data!** + +- Keep `secret.key` safe and never share it. Losing this file means losing access to all encrypted passwords. + +--- + +## ๐Ÿ‘จโ€๐Ÿ’ป Authors + +Developed with Python by a security-conscious developer using: +- `tkinter` for GUI +- `sqlite3` for local storage +- `cryptography` for encryption + +--- + +## โš  Disclaimer + +This tool is intended for educational and personal use. For handling sensitive credentials, professional-grade tools (like Bitwarden or 1Password) are recommended. + +--- + +## ๐Ÿ“œ License + +This project is licensed under the MIT License. See `LICENSE` for details. diff --git a/PASSWORDMANAGE/__pycache__/db_operations.cpython-312.pyc b/PASSWORDMANAGE/__pycache__/db_operations.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b199ae569f12f695379045f45256fcb53afb43e1 GIT binary patch literal 5283 zcmcgwU2GHC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D-nE+dH_3ex26?!R{ai?H9TMQL`?f&c&zP;m@4W0 zg+m%=;fFsM@s>kfOK*vy*aVBEYz*&f*GH^E9hRXp{ zx;77=zR*x`FpT^f5Ywl`c3Z1MbhJ7|M@s^j_74Y##P)L?BL440A+O>p0ey*>Iy;pz zcqk-g#l)tGH5H=>$!!}-;8j!=;fdOU!iS<21wvG9L}3CH2Q>kT!UAcz4N}V_7n@WI zrB<5+%G&230H)P-^Ro*_GXg|056f1(%^4TQGp83$uX$Tnysb;A$M3JSy|dQVwbItL z+V4z-Q`8NqEC3h%Y zpQp=Eus_%n7LSO%g98`EblJ8YeucJFMF;%~t;H*|glG4P1tGbLm|(cZ;XZRC8jst= zks%5+i30^7j=@K#AOe(a##me_B!}UNPiQG8G%>2|5y0Eo(Tc&S$r+=1`?#%9`)witprC-mgCRL*1(Hy*1zY72o+) zU*EIJrk9nCYnAOQmF?M@`iIm)@9tS^u3R`${ZArPd2<51Ay-Fge4C9hyG;UO9fd{7 zN8O(8qs-HzT=&UB=YtS8DJfc%EaiM`mtwjL=w6&&AcR2=db2(&!^!_0gMFGJ>pO>EIJ|6 zS#&Rs0}{=e16{0%Ke!MagupR?m2C#9ZLrZ&ndxEFBT%+Ta|TPhdl@vdc`xI*89VqZ z>1GPr`axU!6$oHNdDVQ&{m~5lKk_$~*~$YM9r$#xh)=XTxU0YUBmJzY=eZ|<9w%se zoS^A(f{w?jY3pX0r!3c96kFwQ6~BZ9ee11)fm;Q}J9w*Lbq0XO=u9bi=dC%XbEO~- zFr&sP=i2>75QCe=b~qCN`wV!ptaJVAfN}`dCh-ep*%u4covmuuP(%Q!!^v9Ff%ZFKJ8 zg490_2%KaMgsKv&?t{$mn$9nIU5!rNnC-MaaG4)DRP#*%=(GLyE!P=qDP3wWG@!fH b>OtffilY8P_WqT$Zt_>', item_selected) + + self.records_tree.grid() + + + #Copy to Clipboard + def copy_password(self): + self.root.clipboard_clear() + self.root.clipboard_append(self.entry_boxes[3].get()) + message= "Password Copied" + title= "Copy" + if self.entry_boxes[3].get()=="": + message= "Box is empty" + title= "Error" + self.showmessage(title, message) + + def showmessage(self, title_box:str=None, message:str=None): + TIME_TO_WAIT= 900 #in milliseconds + root= Toplevel(self.root) + background='green' + if title_box== "Error": + background= "red" + root.geometry('200x30+600+200') + root.title(title_box) + Label(root, text=message, background=background, font=("Times New Roman", 15), fg='white').pack(padx=4, pady=2) + try: + root.after(TIME_TO_WAIT, root.destroy) + except Exception as e: + print("Error occured", e) + + + + +def launch_main_app(): + root = Tk() + db_class = DbOperations() + db_class.create_table() + root_class = root_window(root, db_class) + root.mainloop() + +if __name__ == "__main__": + login_root = Tk() + LoginWindow(login_root, on_success=launch_main_app) + login_root.mainloop() diff --git a/PASSWORDMANAGE/password_records.db b/PASSWORDMANAGE/password_records.db new file mode 100644 index 0000000000000000000000000000000000000000..a1e7c09e7c02c56428881c203ef690ab85265b54 GIT binary patch literal 12288 zcmeI&+iu!07yw`gc9z!mu9vkmX@FXgIhCqXr5P}5AW#}iIozNSOv!+RCa|!}PTEWC zP4-fKhB-`BOSNh0t~Tla6+3b4-?G0uOKx3i)>7cH~F8-sL0Ma+W9Ig2oL}P5C8!X009sH0T2KI5CDPyTA&$uwtsl2 z^p?hOCcK-OJX8)makCP(`LG!+>5OuQIW1}oKNuUgjk!3InTgM)@_auQQ@%Xi%(*Z; z&v)F>z_Q0qs1XUx7wW?CSNNw;%UEr2_MYjusjGFW_i&B%Fm3Y-wIOGzvj)eF3t8Hl zb`(lAU12Q6XfTpB=4zd_IITBvnN?_8`O1u@DJQ+cB_p{Gp`DgfV?%$!KlD%3t6Wn%uA1GCHC`Bui~1~0kLRL7+Mjak zHLXss)19e18Lg)M%GAo3Ck58A){BCFcJ|}^e}{JO9=Aal4FVtl0w4eaAOHd&00JNY X0w4eaAn>mW>?zUM%k52o%}t8$I!V7R literal 0 HcmV?d00001 diff --git a/PASSWORDMANAGE/secret.key b/PASSWORDMANAGE/secret.key new file mode 100644 index 0000000..8a305ce --- /dev/null +++ b/PASSWORDMANAGE/secret.key @@ -0,0 +1 @@ +zcnj1Ex1bjddCvAW7D7b5FM5UCk4k2a3aQwQuytIolI= \ No newline at end of file