π Password Manager Python Project (Tkinter + Encryption) | Fuzzu Developer Tool
Demo :
Click Video πππ
Kya aap bhi passwords bhool jaate ho? π Fuzzu Developer lekar aaya hai ek fully encrypted Python Password Manager with π modern UI & secure storage! Ye project beginner se leke pro tak sabke liye hai!
Features:
✅ Full Source Code
✅ Folder Structure
✅ SEO Optimized
✅ Embedded YouTube Shorts
✅ “Developed by Fuzzu Developer” credit
✅ CTA for Download, Subscribe, Share
Code :
import os
import sqlite3
import tkinter as tk
from tkinter import ttk, messagebox, filedialog
from cryptography.fernet import Fernet
import csv
import json
# --- Setup encryption key ---
KEY_FILE = "secret.key"
def generate_key():
key = Fernet.generate_key()
with open(KEY_FILE, "wb") as f:
f.write(key)
def load_key():
if not os.path.exists(KEY_FILE):
generate_key()
with open(KEY_FILE, "rb") as f:
return f.read()
key = load_key()
fernet = Fernet(key)
# --- Database setup ---
os.makedirs('database', exist_ok=True)
conn = sqlite3.connect('database/credentials.db')
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS credentials (
id INTEGER PRIMARY KEY AUTOINCREMENT,
platform TEXT NOT NULL,
username TEXT NOT NULL,
password TEXT NOT NULL
)
''')
conn.commit()
# --- GUI Setup ---
root = tk.Tk()
root.title("π Fuzzu Cyber Vault - Password Manager")
root.geometry("600x650")
root.configure(bg="#121212")
# Style configuration
style = ttk.Style()
style.theme_use("clam")
style.configure("TLabel", background="#121212", foreground="white", font=("Segoe UI", 10))
style.configure("TEntry", font=("Segoe UI", 10))
style.configure("TButton", background="#1f1f1f", foreground="white", font=("Segoe UI", 10))
style.map("TButton",
background=[('active', '#2e2e2e')],
foreground=[('active', 'white')])
# --- Functions ---
def save_credentials():
platform = platform_entry.get()
username = username_entry.get()
password = password_entry.get()
if platform and username and password:
enc_password = fernet.encrypt(password.encode()).decode()
cursor.execute("INSERT INTO credentials (platform, username, password) VALUES (?, ?, ?)",
(platform, username, enc_password))
conn.commit()
messagebox.showinfo("Success", "Credentials saved successfully!")
platform_entry.delete(0, tk.END)
username_entry.delete(0, tk.END)
password_entry.delete(0, tk.END)
show_credentials()
else:
messagebox.showwarning("Error", "Please fill all fields.")
def show_credentials(filter_text=""):
for row in tree.get_children():
tree.delete(row)
if filter_text:
cursor.execute("SELECT * FROM credentials WHERE platform LIKE ? OR username LIKE ?",
(f'%{filter_text}%', f'%{filter_text}%'))
else:
cursor.execute("SELECT * FROM credentials")
rows = cursor.fetchall()
for row in rows:
dec_password = fernet.decrypt(row[3].encode()).decode()
tree.insert('', tk.END, values=(row[1], row[2], dec_password))
def search():
filter_text = search_entry.get()
show_credentials(filter_text)
def export_data(format):
cursor.execute("SELECT * FROM credentials")
rows = cursor.fetchall()
if not rows:
messagebox.showwarning("No Data", "No data to export.")
return
file = filedialog.asksaveasfilename(defaultextension=f".{format}", filetypes=[(format.upper(), f"*.{format}")])
if not file:
return
data = [
{
"Platform": row[1],
"Username": row[2],
"Password": fernet.decrypt(row[3].encode()).decode()
}
for row in rows
]
try:
if format == "csv":
with open(file, "w", newline='', encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=data[0].keys())
writer.writeheader()
writer.writerows(data)
elif format == "json":
with open(file, "w", encoding="utf-8") as f:
json.dump(data, f, indent=4)
messagebox.showinfo("Export Successful", f"Data exported to {file}")
except Exception as e:
messagebox.showerror("Error", str(e))
# --- Widgets ---
ttk.Label(root, text="Platform:").pack(pady=(10, 2))
platform_entry = ttk.Entry(root, width=40)
platform_entry.pack()
ttk.Label(root, text="Username:").pack(pady=(10, 2))
username_entry = ttk.Entry(root, width=40)
username_entry.pack()
ttk.Label(root, text="Password:").pack(pady=(10, 2))
password_entry = ttk.Entry(root, width=40, show="*")
password_entry.pack()
ttk.Button(root, text="Save", command=save_credentials).pack(pady=10)
# Search Bar
ttk.Label(root, text="Search Platform or Username:").pack(pady=(20, 2))
search_entry = ttk.Entry(root, width=30)
search_entry.pack()
ttk.Button(root, text="Search", command=search).pack(pady=5)
# Treeview to display credentials
tree = ttk.Treeview(root, columns=('Platform', 'Username', 'Password'), show='headings', height=8)
tree.heading('Platform', text='Platform')
tree.heading('Username', text='Username')
tree.heading('Password', text='Password')
tree.pack(pady=20, fill=tk.X, padx=20)
# Export Buttons
frame_export = ttk.Frame(root)
frame_export.pack(pady=10)
ttk.Button(frame_export, text="Export as CSV", command=lambda: export_data("csv")).pack(side="left", padx=5)
ttk.Button(frame_export, text="Export as JSON", command=lambda: export_data("json")).pack(side="left", padx=5)
# Load credentials at startup
show_credentials()
root.mainloop()
Comments
Post a Comment