A secure multi-organization threat intelligence sharing system with end-to-end encryption, digital signatures, and homomorphic analytics.
Aegis enables organizations to securely share threat intelligence alerts while preserving privacy through:
- Hybrid Encryption: RSA + AES-GCM for alert confidentiality
- Digital Signatures: RSA-PSS for authenticity verification
- Homomorphic Encryption: Paillier encryption for privacy-preserving risk score aggregation
- Password-Protected Keys: Client-side decryption only
- HMAC-Based Search: Privacy-preserving alert discovery
- Organization registration with JWT-based authentication
- Encrypted alert submission and retrieval
- Privacy-preserving alert search using HMAC beacons
- Homomorphic aggregation of encrypted risk scores
- Analytics dashboard with server-signed responses
- Session management with auto-logout
- Account security (failed login attempts, lockouts)
Backend:
- FastAPI (Python)
- PostgreSQL
- Cryptography libraries (phe, cryptography)
- JWT authentication
Frontend:
- Vanilla JavaScript
- Chart.js for analytics
- Web Crypto API for client-side encryption
- Python 3.8+
- PostgreSQL
- Node.js (for frontend dependencies)
- Clone repository and install dependencies:
pip install -r requirements.txt- Configure environment:
Create .env file:
POSTGRES_DB=threatintel
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_password
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
JWT_SECRET_KEY=your_64_char_hex_key- Initialize database:
python src/app/db/init_db.py- Generate Paillier keys:
python src/scripts/init_paillier_keys.py- Generate server signing keys:
python src/scripts/generate_server_keys.pyStart backend server:
python src/app/main.pyServer runs on http://localhost:8000
Serve frontend:
Use any HTTP server, e.g.:
python -m http.server 8080 --directory frontendAccess at http://localhost:8080
- Navigate to register page
- Provide organization ID, name, email, and password
- Save the encrypted private key (displayed once)
- Password is required for key decryption
- Login with organization credentials
- Navigate to "Submit Alert" tab
- Fill alert details (type, severity, source, risk score, description)
- Alert is encrypted client-side before submission
- Digital signature proves authenticity
- Select alert type to generate HMAC beacon
- System searches without revealing search terms
- Results show matching alerts with submitter info
- Decrypt your own alerts with your password
- View aggregated statistics across all organizations
- Risk scores aggregated using homomorphic encryption
- Server signature verification ensures data integrity
- Charts show trends, types, and risk levels
- Private keys never leave client device
- Password-based key derivation (PBKDF2)
- AES-256-GCM for alert encryption
- RSA key wrapping for AES keys
- JWT access tokens (60 min expiry)
- Refresh tokens (7 day expiry)
- Failed login lockout (5 attempts, 30 min lockout)
- Audit logging for security events
- Connection pooling with timeout protection
- Server cannot decrypt alerts or private keys
- Homomorphic operations on encrypted data
- HMAC beacons for searchability without plaintext exposure
- Minimal metadata exposure
POST /api/v1/auth/login- Obtain JWT tokensPOST /api/v1/auth/refresh- Refresh access tokenPOST /api/v1/auth/logout- Revoke refresh token
POST /api/v1/orgs/register- Register new organizationGET /api/v1/orgs/list- List all organizationsGET /api/v1/orgs/{org_id}- Get organization detailsGET /api/v1/orgs/me/info- Get own organization infoGET /api/v1/orgs/me/alerts- Get own submitted alertsGET /api/v1/orgs/me/encrypted-key- Retrieve encrypted private keyGET /api/v1/orgs/paillier/public-key- Get Paillier public keyGET /api/v1/orgs/server/public-key- Get server's signature verification key
POST /api/v1/alerts/submit- Submit encrypted alertGET /api/v1/alerts/search- Search by HMAC beaconGET /api/v1/alerts/{alert_id}/decrypt- Get alert for decryptionGET /api/v1/alerts/aggregate- Aggregate encrypted risk scoresGET /api/v1/alerts/analytics/summary- Get analytics dashboard data
organizations: Org credentials, encrypted keys, account status
rsa_keys: Organization RSA public keys
alerts: Encrypted alert payloads, wrapped keys, signatures, Paillier ciphertexts
refresh_tokens: JWT refresh token management
audit_logs: Security event logging
├── frontend/ # Web interface
├── keys/ # Cryptographic keys (gitignored)
├── src/
│ ├── app/
│ │ ├── api/v1/ # API routes
│ │ ├── crypto/ # Encryption utilities
│ │ ├── db/ # Database setup and migrations
│ │ ├── models/ # Pydantic models
│ │ └── utils/ # Helper functions
│ └── scripts/ # Initialization scripts
├── .env # Environment configuration
└── requirements.txt # Python dependencies
Edit config.js to set:
API_BASE_URL: Backend server URLAUTO_LOGOUT_MINUTES: Session timeout duration
python src/scripts/reset_db.pypython src/app/db/migrate.pyAccess interactive API docs at http://localhost:8000/docs when server is running.