Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔒 Secure Messenger Shield

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.


📌 Project Overview

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.


✨ Features

🔐 Secure User Authentication

  • User Registration
  • User Login & Logout
  • Password Hashing using Flask-Bcrypt
  • JWT Authentication
  • Session Management

🔒 End-to-End Message Encryption

  • Messages encrypted using Fernet (Cryptography Library)
  • Encrypted messages stored securely in the database
  • Messages decrypted only when displayed

🛡️ Security Protection

  • XSS Protection using Bleach
  • SQL Injection Prevention using SQLAlchemy ORM
  • Password Validation
  • Email Validation
  • Username Validation

🚦 Rate Limiting

  • Prevents brute-force or spam attacks
  • Limits the number of messages a user can send within a specified time
  • Automatically blocks excessive requests

📊 Security Dashboard

Displays:

  • Total Registered Users
  • Total Encrypted Messages
  • Successful Logins
  • Failed Login Attempts
  • XSS Attempts Blocked
  • Rate Limit Violations

📄 PDF Security Report

Generate downloadable security reports containing:

  • Registered Users
  • Encrypted Messages
  • Login Statistics
  • XSS Detection Count
  • Rate Limit Events

📝 Security Event Logging

Every important activity is logged, including:

  • User Registration
  • Login Success
  • Login Failure
  • Encrypted Message Sent
  • XSS Attempt Blocked
  • Rate Limit Triggered

🛠️ Tech Stack

Backend

  • Python
  • Flask
  • Flask SQLAlchemy
  • Flask JWT Extended
  • Flask Bcrypt
  • Flask Limiter

Security Libraries

  • Cryptography (Fernet Encryption)
  • Bleach (XSS Protection)

Frontend

  • HTML5
  • CSS3
  • JavaScript

Database

  • SQLite

Reporting

  • ReportLab

📂 Project Structure

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

⚙️ Installation

Clone the repository

git clone https://github.com/yourusername/SecureMessenger.git

Move into the project

cd SecureMessenger

Create virtual environment

python -m venv venv

Activate environment

Windows

venv\Scripts\activate

Linux / macOS

source venv/bin/activate

Install dependencies

pip install -r requirements.txt

Run the application

python app.py

Open

http://127.0.0.1:5000

🔐 Security Features Implemented

✅ Password Hashing

✅ JWT Authentication

✅ Session Management

✅ Message Encryption

✅ XSS Protection

✅ SQL Injection Prevention

✅ Rate Limiting

✅ Security Event Logging

✅ Dashboard Analytics

✅ PDF Report Generation


📸 Screenshots

Add screenshots here after deployment.

  • Home Page
  • Login Page
  • Register Page
  • Dashboard
  • Secure Messenger
  • PDF Report

🚀 Future Enhancements

  • Real-time messaging using WebSockets
  • Two-Factor Authentication (2FA)
  • Email Verification
  • Password Reset
  • AES File Encryption
  • User-to-User Messaging
  • Admin Dashboard
  • Docker Deployment

👨‍💻 Developed By

Arshdeep Kaur

Cyber Security Internship Project

Built using Flask and Python.


📄 License

This project is developed for educational and internship purposes.

About

Secure Messaging Web Application using Flask with Encryption, JWT Authentication, XSS Protection and Security Dashboard.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages