SecureChat is a modern Flask-based communication platform designed around three core principles:
- 🔐 Security
- 🤖 Intelligence
- 🔎 Transparency
The project combines secure authentication, encrypted messaging, AI assistance, and a visual encryption inspector into a single web application.
- Google OAuth 2.0 authentication
- Secure Flask session management
- Environment-based configuration for sensitive credentials
- Symmetric message encryption using the
cryptographylibrary - Randomized encryption for each message
- Encrypted communication designed to protect message contents
- Integrated Google Gemini AI
- Dedicated AI chat mode
- Real-time interaction with the AI assistant
- Error handling for API limitations
- Displays plaintext and encrypted ciphertext
- Provides a visual demonstration of the encryption process
- Toggleable inspector interface
- Dark-mode interface
- Glassmorphism design
- Animated WebGL background
- Responsive layout
- Smooth visual transitions
| Component | Technology |
|---|---|
| Backend | Python, Flask |
| Real-time Communication | Flask-SocketIO |
| Frontend | HTML5, CSS3, JavaScript |
| Encryption | Python Cryptography / Fernet |
| Authentication | Authlib, Google OAuth 2.0 |
| AI | Google Gemini |
| Configuration | Python-dotenv |
SecureChat/
├── app.py
├── auth.py
├── encryption.py
├── ai_handler.py
├── logger.py
├── requirements.txt
├── FINAL_PROJECT_REPORT.md
├── static/
│ ├── style.css
│ └── shader.js
├── templates/
│ ├── index.html
│ └── login.html
└── .gitignore
Sensitive credentials and local configuration files are excluded from version control using .gitignore.
The repository excludes:
.env- Encryption keys
- Virtual environments
- Local logs
- Python cache files
Never commit API keys, OAuth client secrets, encryption keys, or other sensitive credentials to the repository.
SecureChat was developed as a security-focused modernization project, transforming a basic Flask-based chat application into a more secure and feature-rich communication platform.
The project demonstrates practical implementation of:
- Authentication
- Encryption
- Secure configuration
- AI integration
- Real-time communication
- Security transparency
git clone https://github.com/Mannat29/securechat.git
cd securechatOn Windows:
python -m venv .venvActivate the virtual environment:
.venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the project directory and configure the required application credentials.
Example:
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GEMINI_API_KEY=your_gemini_api_key
SECRET_KEY=your_secret_key
Do not commit the .env file or any credentials to GitHub.
python app.pyThe application can then be accessed through the local Flask server.
This project is intended primarily for educational and demonstration purposes.
For production deployment, additional security controls should be implemented, including:
- HTTPS/TLS
- Secure production secret management
- Production OAuth configuration
- Secure cookie configuration
- Rate limiting
- Input validation
- Production-grade logging and monitoring
- Proper access control
- Secure deployment configuration
A detailed project report describing the project overview, implemented features, technical architecture, security mechanisms, and design is available in:
FINAL_PROJECT_REPORT.md
Mannat Tomar