A secure messaging web application developed using Flask as part of a Cyber Security Internship Project. The application demonstrates secure authentication, encrypted messaging, protection against common web attacks, security monitoring, and PDF report generation.
Secure Messenger Shield is designed to showcase practical cybersecurity concepts in a real-world web application. It allows users to securely register, authenticate, exchange encrypted messages, and monitor security-related events through an interactive dashboard.
The project focuses on implementing security best practices rather than just building a messaging application.
- User Registration
- User Login & Logout
- Password Hashing using Flask-Bcrypt
- JWT Authentication
- Session Management
- Messages encrypted using Fernet (Cryptography Library)
- Encrypted messages stored securely in the database
- Messages decrypted only when displayed
- XSS Protection using Bleach
- SQL Injection Prevention using SQLAlchemy ORM
- Password Validation
- Email Validation
- Username Validation
- Prevents brute-force or spam attacks
- Limits the number of messages a user can send within a specified time
- Automatically blocks excessive requests
Displays:
- Total Registered Users
- Total Encrypted Messages
- Successful Logins
- Failed Login Attempts
- XSS Attempts Blocked
- Rate Limit Violations
Generate downloadable security reports containing:
- Registered Users
- Encrypted Messages
- Login Statistics
- XSS Detection Count
- Rate Limit Events
Every important activity is logged, including:
- User Registration
- Login Success
- Login Failure
- Encrypted Message Sent
- XSS Attempt Blocked
- Rate Limit Triggered
- Python
- Flask
- Flask SQLAlchemy
- Flask JWT Extended
- Flask Bcrypt
- Flask Limiter
- Cryptography (Fernet Encryption)
- Bleach (XSS Protection)
- HTML5
- CSS3
- JavaScript
- SQLite
- ReportLab
SecureMessenger/
│
├── app.py
├── config.py
├── models.py
├── requirements.txt
│
├── database/
│ └── messenger.db
│
├── reports/
│
├── static/
│ ├── css/
│ ├── js/
│
├── templates/
│ ├── base.html
│ ├── index.html
│ ├── login.html
│ ├── register.html
│ ├── dashboard.html
│ ├── chat.html
│ └── report.html
│
└── utils/
├── encryption.py
├── jwt_auth.py
├── limiter.py
├── report.py
├── sanitizer.py
└── validators.py
Clone the repository
git clone https://github.com/yourusername/SecureMessenger.gitMove into the project
cd SecureMessengerCreate virtual environment
python -m venv venvActivate environment
Windows
venv\Scripts\activateLinux / macOS
source venv/bin/activateInstall dependencies
pip install -r requirements.txtRun the application
python app.pyOpen
http://127.0.0.1:5000
✅ Password Hashing
✅ JWT Authentication
✅ Session Management
✅ Message Encryption
✅ XSS Protection
✅ SQL Injection Prevention
✅ Rate Limiting
✅ Security Event Logging
✅ Dashboard Analytics
✅ PDF Report Generation
Add screenshots here after deployment.
- Home Page
- Login Page
- Register Page
- Dashboard
- Secure Messenger
- PDF Report
- Real-time messaging using WebSockets
- Two-Factor Authentication (2FA)
- Email Verification
- Password Reset
- AES File Encryption
- User-to-User Messaging
- Admin Dashboard
- Docker Deployment
Arshdeep Kaur
Cyber Security Internship Project
Built using Flask and Python.
This project is developed for educational and internship purposes.