Breezip Password [new] -

class BreeZipPassword: def (self): self.master_password = None self.data = {}

def load(self): """Load encrypted storage file.""" if not os.path.exists(STORAGE_FILE): self.data = {} return try: with open(STORAGE_FILE, "r") as f: enc_content = f.read().strip() if not enc_content: self.data = {} return self.master_password = getpass.getpass("Master password: ") json_str = self._decrypt(enc_content, self.master_password) self.data = json.loads(json_str) except Exception: print("❌ Decryption failed. Wrong master password or corrupted file.") self.data = {} self.master_password = None

def _decrypt(self, enc_data: str, password: str) -> str: """Decrypt AES-256-CBC encrypted data.""" raw = base64.b64decode(enc_data) salt = raw[:SALT_SIZE] iv = raw[SALT_SIZE:SALT_SIZE + IV_SIZE] ciphertext = raw[SALT_SIZE + IV_SIZE:] key = self._derive_key(password, salt) cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend()) decryptor = cipher.decryptor() decrypted_padded = decryptor.update(ciphertext) + decryptor.finalize() # Remove padding return decrypted_padded.rstrip(b"\x00").decode() breezip password

def add_entry(self): """Add a new service password entry.""" service = input("Service name (e.g., Gmail): ").strip() if not service: print("❌ Service name required.") return username = input("Username/Email: ").strip() gen_choice = input("Generate password? (y/n): ").lower() if gen_choice == 'y': length = int(input("Length (default 16): ") or 16) password = self.generate_password(length) print(f"🔑 Generated password: password") else: password = getpass.getpass("Password: ") notes = input("Optional notes: ").strip() self.data[service] = "username": username, "password": password, "notes": notes self.save() print(f"✅ Entry for 'service' added.")

def generate_password(self, length=16, use_digits=True, use_special=True): """Generate a strong random password.""" chars = string.ascii_letters if use_digits: chars += string.digits if use_special: chars += "!@#$%^&*()-_=+[]{}|;:,.<>?" return ''.join(secrets.choice(chars) for _ in range(length)) class BreeZipPassword: def (self): self

def list_services(self): """List all stored service names.""" if not self.data: print("⚠️ No entries.") else: print("\n📋 Stored services:") for i, service in enumerate(self.data.keys(), 1): print(f"i. service")

---

pip install -r requirements.txt #!/usr/bin/env python3 """ BreeZip Password Manager Securely store and retrieve passwords with AES-256 encryption. """ import os import json import base64 import getpass import secrets import string from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.backends import default_backend