Python Password Manager – Full-Stack Project

Password Manager – A Security-Focused Full-Stack Python Project

Password Manager – A Security-Focused Full-Stack Python Project

English Version

This project started as a simple desktop application from the 100 Days of Code – The Complete Python Pro Bootcamp course. What began as a basic password storage tool quickly became something much more ambitious: a fully architected, security-focused application with encryption, a REST API backend, JWT authentication, and a proper database — built step by step with a focus on understanding every decision along the way.

Password Manager Desktop Application
The tkinter desktop client — clean, simple, and connected to a secure API backend.

Architecture Overview

The application is built around a clean client-server architecture. The tkinter desktop GUI acts as a client that communicates exclusively through a FastAPI REST API. The API handles all business logic, encryption, and database access. This separation means any future client — a web browser, a mobile app — can connect to the same backend without changing a single line of server code.

Tkinter GUI Client
       ↓  HTTP Requests (JWT token)
  FastAPI Backend
       ↓
  SQLite Database (SQLAlchemy ORM)

Technologies & Skills Demonstrated

  • Python (application logic, encryption, authentication)
  • FastAPI (REST API backend with automatic documentation)
  • SQLAlchemy ORM (database models and queries)
  • SQLite (local relational database)
  • Fernet (AES) encryption (cryptography library — all stored passwords encrypted at rest)
  • bcrypt (master password hashing — one-way, never stored in plain text)
  • JWT authentication (token-based protection of all API endpoints)
  • Tkinter (desktop GUI client)
  • Environment variables & .gitignore (secure configuration — no secrets in version control)
  • Git / GitHub (version control with meaningful commit history)

FastAPI automatic documentation showing protected endpoints
FastAPI's automatic documentation — note the lock icons on the protected endpoints.

Security Features

Security was treated as a first-class concern throughout, not an afterthought:

  • Fernet encryption: Every password stored in the database is encrypted using AES symmetric encryption. Even if the database file is stolen, the contents are unreadable without the secret key.
  • bcrypt master password: The application's master password is never stored in plain text. It is hashed using bcrypt with a random salt, making brute-force and rainbow table attacks computationally infeasible.
  • JWT token authentication: After login, the API issues a signed JSON Web Token. Every subsequent request must include this token. Requests without a valid token are rejected with a 401 Unauthorized response before any data is accessed.
  • Secrets never in version control: The encryption key, master password hash, and database file are all excluded from Git via .gitignore. A .env pattern is followed for all sensitive configuration.

What I Built

The application allows users to generate strong random passwords, save them against a website and email address, and retrieve them on demand. All stored passwords are encrypted before hitting the database. The master password login screen protects the entire application on startup. The FastAPI backend exposes three protected endpoints: POST /login, POST /passwords, and GET /passwords/{website}.

What This Project Taught Me

  • Designing a multi-layer application with proper separation of concerns
  • Implementing real encryption and understanding the difference between hashing and encryption
  • Building and securing a REST API with FastAPI and JWT tokens
  • Using SQLAlchemy ORM to interact with a relational database without raw SQL
  • Connecting a desktop GUI client to a backend API using the requests library
  • Managing sensitive files securely — environment variables, .gitignore, secret keys
  • Reading and understanding error tracebacks to debug real environment issues
  • Thinking about software architecture before writing code

What's Next

The project is still evolving. Planned next steps include multi-user support with per-user encrypted data, a PostgreSQL production database, and a web frontend — turning this into a fully deployable cloud application accessible from any browser.

You can explore the complete project here:

GitHub – Password Manager


Ελληνική Έκδοση

Αυτό το project ξεκίνησε ως μια απλή εφαρμογή desktop από το μάθημα 100 Days of Code – The Complete Python Pro Bootcamp. Από ένα βασικό εργαλείο αποθήκευσης κωδικών, εξελίχθηκε σε μια ολοκληρωμένη εφαρμογή με κρυπτογράφηση, REST API backend, JWT authentication και σωστή βάση δεδομένων — χτισμένη βήμα-βήμα με έμφαση στην κατανόηση κάθε απόφασης κατά τη διαδρομή.

Εφαρμογή Password Manager
Το tkinter desktop client — απλό, καθαρό και συνδεδεμένο με ασφαλές API backend.

Αρχιτεκτονική

Η εφαρμογή βασίζεται σε αρχιτεκτονική client-server. Το tkinter GUI λειτουργεί ως client που επικοινωνεί αποκλειστικά μέσω ενός FastAPI REST API. Το API αναλαμβάνει όλη τη λογική, την κρυπτογράφηση και την πρόσβαση στη βάση δεδομένων. Αυτός ο διαχωρισμός σημαίνει ότι οποιοδήποτε μελλοντικό client — web browser, mobile app — μπορεί να συνδεθεί στο ίδιο backend χωρίς να αλλάξει καμία γραμμή κώδικα στον server.

Τεχνολογίες & Δεξιότητες

  • Python (λογική εφαρμογής, κρυπτογράφηση, authentication)
  • FastAPI (REST API backend με αυτόματη τεκμηρίωση)
  • SQLAlchemy ORM (μοντέλα και ερωτήματα βάσης δεδομένων)
  • SQLite (τοπική σχεσιακή βάση δεδομένων)
  • Κρυπτογράφηση Fernet (AES) (όλοι οι αποθηκευμένοι κωδικοί κρυπτογραφημένοι)
  • bcrypt (hashing του master password — μονόδρομο, ποτέ σε plain text)
  • JWT authentication (προστασία με token όλων των endpoints του API)
  • Tkinter (desktop GUI client)
  • Environment variables & .gitignore (ασφαλής διαχείριση — κανένα secret στο version control)
  • Git / GitHub (version control με ουσιαστικό ιστορικό commits)

FastAPI αυτόματη τεκμηρίωση με προστατευμένα endpoints
Η αυτόματη τεκμηρίωση του FastAPI — παρατηρήστε τα εικονίδια κλειδαριάς στα προστατευμένα endpoints.

Χαρακτηριστικά Ασφαλείας

Η ασφάλεια αντιμετωπίστηκε ως πρωταρχική προτεραιότητα, όχι ως δευτερεύον ζήτημα:

  • Κρυπτογράφηση Fernet: Κάθε κωδικός που αποθηκεύεται κρυπτογραφείται με AES. Ακόμα και αν κλαπεί το αρχείο της βάσης, τα περιεχόμενα είναι αδύνατο να διαβαστούν χωρίς το μυστικό κλειδί.
  • bcrypt master password: Το master password δεν αποθηκεύεται ποτέ σε plain text. Γίνεται hash με bcrypt και τυχαίο salt, καθιστώντας επιθέσεις brute-force και rainbow table μη πρακτικές.
  • JWT token authentication: Μετά το login, το API εκδίδει ένα υπογεγραμμένο JSON Web Token. Κάθε επόμενο αίτημα πρέπει να περιλαμβάνει αυτό το token. Αιτήματα χωρίς έγκυρο token απορρίπτονται με 401 Unauthorized.
  • Κανένα secret στο version control: Το κλειδί κρυπτογράφησης, το hash του master password και το αρχείο βάσης δεδομένων εξαιρούνται από το Git μέσω .gitignore.

Τι περιλαμβάνει η εφαρμογή

Η εφαρμογή επιτρέπει τη δημιουργία ισχυρών τυχαίων κωδικών, την αποθήκευσή τους με website και email, και την ανάκτησή τους ανά πάσα στιγμή. Όλοι οι κωδικοί κρυπτογραφούνται πριν φτάσουν στη βάση. Η οθόνη login με master password προστατεύει ολόκληρη την εφαρμογή κατά την εκκίνηση. Το FastAPI backend εκθέτει τρία προστατευμένα endpoints: POST /login, POST /passwords και GET /passwords/{website}.

Δεξιότητες που ανέπτυξα

  • Σχεδιασμός πολυεπίπεδης εφαρμογής με σωστό διαχωρισμό ευθυνών
  • Υλοποίηση πραγματικής κρυπτογράφησης και κατανόηση της διαφοράς μεταξύ hashing και encryption
  • Κατασκευή και ασφάλιση REST API με FastAPI και JWT tokens
  • Χρήση SQLAlchemy ORM για αλληλεπίδραση με σχεσιακή βάση δεδομένων
  • Σύνδεση desktop GUI client με backend API μέσω της βιβλιοθήκης requests
  • Ασφαλής διαχείριση ευαίσθητων αρχείων — environment variables, .gitignore, secret keys
  • Ανάγνωση και κατανόηση error tracebacks για debugging πραγματικών προβλημάτων περιβάλλοντος
  • Σκέψη για την αρχιτεκτονική του λογισμικού πριν τη συγγραφή κώδικα

Επόμενα Βήματα

Το project συνεχίζει να εξελίσσεται. Τα επόμενα βήματα περιλαμβάνουν υποστήριξη πολλαπλών χρηστών με κρυπτογράφηση ανά χρήστη, βάση δεδομένων PostgreSQL για production, και web frontend — μετατρέποντάς το σε πλήρως αναπτύξιμη εφαρμογή cloud προσβάσιμη από οποιοδήποτε browser.

Μπορείτε να δείτε ολόκληρο το project εδώ:

GitHub – Password Manager


This article is written in both English and Greek to support both local and international recruiters and readers.

Από jkayabas_dev jkayabas_dev

Σχόλια

Δεν υπάρχουν σχόλια ακόμα.

Συνδεθείτε για να σχολιάσετε.