You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive quantum-resistant email client with multi-layer encryption including AES-256-GCM, One-Time Pad (OTP), and Post-Quantum Cryptography (PQC) using CRYSTALS-Kyber.
🏗️ Architecture Overview
This application consists of multiple components working together:
Frontend: Flutter desktop application (Windows)
Backend: .NET 8 Web API with authentication and email management
Database: PostgreSQL for user authentication and email storage
Crypto Services: Multiple Python services for different encryption layers
Key Manager (Port 80802020): Manages quantum keys
OTP API (Port 80812021): One-Time Pad encryption/decryption
AES Server (Port 80822022): AES-256-GCM encryption/decryption
Main Backend API (Port 5001): Handles PQC operations and all email functionality
📋 Prerequisites
Before setting up the application, ensure you have the following installed:
Required Software
PostgreSQL 17+ - Database server
.NET 8 SDK - Backend API runtime
Flutter SDK 3.8.1+ - Frontend development framework
Python 3.8+ - Crypto services runtime
Git - Version control (for cloning the repository)
During installation, remember the password you set for the postgres user
Create Database and User
-- Connect to PostgreSQL as superuser
psql -U postgres
-- Create databaseCREATEDATABASEquantum_auth;
-- Create user (optional, you can use postgres user)CREATEUSERquantum_user WITH PASSWORD 'your_password_here';
-- Grant privilegesGRANT ALL PRIVILEGES ON DATABASE quantum_auth TO quantum_user;
-- Connect to the database
\c quantum_auth
-- Run the schema files
\i database/schema.sql
\i database/email_schema.sql
-- Connect to PostgreSQL
psql -U postgres
-- Create the application databaseCREATEDATABASEquantum_auth;
-- Connect to the new database
\c quantum_auth
-- Create tables for authenticationCREATETABLEIF NOT EXISTS users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) UNIQUE NOT NULL,
password_hash VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
avatar_url TEXT,
is_active BOOLEAN DEFAULT true,
email_verified BOOLEAN DEFAULT false,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
last_login_at TIMESTAMP WITH TIME ZONE
);
-- Create emails tableCREATETABLEIF NOT EXISTS emails (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
sender_email VARCHAR(255) NOT NULL,
recipient_email VARCHAR(255) NOT NULL,
subject VARCHAR(500) NOT NULL,
body TEXTNOT NULL,
sent_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
is_read BOOLEAN DEFAULT FALSE
);
-- Create indexes for performanceCREATEINDEXIF NOT EXISTS idx_users_email ON users(email);
CREATEINDEXIF NOT EXISTS idx_emails_recipient ON emails(recipient_email);
CREATEINDEXIF NOT EXISTS idx_emails_sender ON emails(sender_email);
-- Insert test user (password: 'password123')INSERT INTO users (email, password_hash, name, email_verified)
VALUES (
'test@example.com',
'$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewdBPj4o4tQ8.7C.',
'Test User',
true
) ON CONFLICT (email) DO NOTHING;
0 commit comments