GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - r-godinez/Lightweight-Crypto-Chat-App: A real-time secure chat application with end-to-end encryption, designed specifically for deployment on single-board computers like the Raspberry Pi 5. This project demonstrates the implementation of robust cryptographic protocols in a lightweight, resource-constrained environment.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
templates
templates
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
server.py
server.py
 
 

Repository files navigation

secure-chat-application

Abstract

This project presents the use of end-to-end lightweight encryption to develop a secure chat application. Implementing secure cryptographic algorithms such as RSA (Rivest-Shamir-Adleman) for key exchange and AES (Advanced Encryption Standard) for message encryption and decryption on a single board computer (SBC). This secure chat application provides real-time password-protected communication with an intuitive user interface enabled with avatar depictions and emoticons, built with Flask and Socket.IO. Performance metrics such as memory usage and latency are logged to evaluate server efficiency of the SBC Raspberry Pi 5. Integrating cryptographic algorithms on a Raspberry Pi 5 offers security solutions for industries in need of secure communication. One of the major challenges in developing this secure chat application is implementing efficient encryption and decryption mechanisms. Managing RSA key exchange between the server and the client requires careful handling to ensure compatibility across different cryptographic libraries and platforms. Additionally, optimizing AES encryption for real-time message processing poses another challenge, as it is important to maintain a balance between strong security and minimal latency to provide a seamless user experience.

Overview

A real-time secure chat application with end-to-end encryption, designed specifically for deployment on single-board computers like the Raspberry Pi 5. This project demonstrates the implementation of robust cryptographic protocols in a lightweight, resource-constrained environment.

Features

šŸ” Security Features

  • RSA Key Exchange: 2048-bit RSA encryption for secure key distribution
  • AES Message Encryption: AES-CBC mode for end-to-end message encryption
  • Password Protection: Simple password authentication (123456)
  • Session Key Management: Dynamic session key generation and distribution

šŸ’¬ Chat Features

  • Real-time Communication: WebSocket-based instant messaging
  • User Management: Join/leave notifications and participant tracking
  • Avatar System: Automatic avatar generation using RoboHash
  • Emoji Support: Built-in emoji picker for enhanced communication
  • Message Timestamps: Full timestamp tracking for all messages

šŸŽØ User Interface

  • Modern Design: Glassmorphism UI with gradient backgrounds
  • Responsive Layout: Optimized for various screen sizes
  • Dark Theme: Eye-friendly dark mode interface
  • Real-time Updates: Live participant list and message updates

Technical Architecture

Backend (Python/Flask)

  • Flask-SocketIO: Real-time bidirectional communication
  • PyCrypto: Cryptographic operations (RSA, AES)
  • Performance Monitoring: Built-in metrics collection
    • Memory usage tracking
    • CPU utilization monitoring
    • Network bandwidth measurement
    • Latency calculation
    • Energy consumption estimation

Frontend (HTML/CSS/JavaScript)

  • Socket.IO Client: Real-time communication
  • Forge.js: Client-side cryptographic operations
  • Bootstrap: Responsive UI framework
  • Font Awesome: Icon library

Installation & Setup

Prerequisites

pip install flask flask-socketio pycryptodome psutil

Running the Application

python server.py

The application will be available at http://localhost:5000

Usage

  1. Open the web interface in your browser
  2. Enter a username and password (123456)
  3. Click "Join" to enter the chatroom
  4. Start sending encrypted messages!

Performance Metrics

The application tracks comprehensive performance metrics:

  • Decryption Time: Time taken to decrypt each message
  • Latency: Network delay between client and server
  • Throughput: Messages processed per second
  • Memory Usage: Server memory consumption
  • CPU Usage: Processor utilization percentage
  • Network Bandwidth: Data sent/received statistics
  • Energy Consumption: Estimated power usage

Security Implementation

Key Exchange Process

  1. Client generates RSA key pair (2048-bit)
  2. Client sends public key to server
  3. Server encrypts session key with client's public key
  4. Client decrypts session key using private key
  5. Both parties use shared session key for AES encryption

Message Encryption Flow

  1. Client encrypts message with AES-CBC using session key
  2. Encrypted message sent to server
  3. Server relays encrypted message to all clients
  4. Each client decrypts message using their session key

Learning Outcomes

Cryptography & Security

  • RSA Implementation: Understanding public-key cryptography
  • AES Encryption: Symmetric encryption for bulk data
  • Key Management: Secure key exchange and distribution
  • End-to-End Security: Ensuring message confidentiality

Real-time Web Development

  • WebSocket Communication: Bidirectional real-time data flow
  • Event-Driven Architecture: Handling multiple concurrent connections
  • Client-Server Synchronization: Managing state across multiple clients

Performance Optimization

  • Resource Monitoring: Tracking system performance metrics
  • Lightweight Implementation: Optimizing for constrained environments
  • Scalability Considerations: Handling multiple concurrent users

Single-Board Computer Deployment

  • Raspberry Pi Optimization: Adapting applications for ARM architecture
  • Resource Management: Efficient use of limited CPU and memory
  • Network Performance: Optimizing for embedded network capabilities

Project Value

This project demonstrates the practical implementation of enterprise-grade security protocols on resource-constrained hardware, making it valuable for:

  • IoT Security: Secure communication in embedded systems
  • Educational Purposes: Learning cryptography and real-time web development
  • Proof of Concept: Demonstrating security feasibility on SBCs
  • Industry Applications: Secure communication solutions for small-scale deployments

File Structure

secure-chat-raspberry-pi-server/
ā”œā”€ā”€ server.py          # Flask server with SocketIO and encryption
ā”œā”€ā”€ static/            # Static assets (CSS, JS, images)
ā”œā”€ā”€ templates/         # HTML templates
│   └── index.html    # Frontend chat interface
ā”œā”€ā”€ docs/             # Documentation
│   ā”œā”€ā”€ ABSTRACT.md   # Project abstract
│   └── presentation.pdf # Project presentation
└── README.md         # This file

Future Enhancements

  • User authentication with database
  • Message persistence and history
  • File sharing capabilities
  • Group chat rooms
  • Mobile app development
  • Advanced security features (perfect forward secrecy)

About

A real-time secure chat application with end-to-end encryption, designed specifically for deployment on single-board computers like the Raspberry Pi 5. This project demonstrates the implementation of robust cryptographic protocols in a lightweight, resource-constrained environment.

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.