https://github.com/vaneeza-7/encrypted-chat-system
A demonstration of key cryptographic algorithms AES, Diffie Hellman, SHA-256, RSA for secure communication in cpp
https://github.com/vaneeza-7/encrypted-chat-system
Last synced: 7 months ago
JSON representation
A demonstration of key cryptographic algorithms AES, Diffie Hellman, SHA-256, RSA for secure communication in cpp
- Host: GitHub
- URL: https://github.com/vaneeza-7/encrypted-chat-system
- Owner: Vaneeza-7
- License: mit
- Created: 2024-11-07T08:24:50.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-24T14:28:37.000Z (9 months ago)
- Last Synced: 2025-01-24T15:27:27.929Z (9 months ago)
- Language: C++
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Secure Chat System with Registration, Login, and Encrypted Communication
## Introduction
This project implements a **Secure Chat System** that provides encrypted communication between clients and a server. It features user registration, login authentication, and secure messaging using **Diffie-Hellman key exchange**, **SHA-256 hashing**, and **AES encryption**.
The system ensures:
- Secure storage of user credentials.
- Confidentiality of messages.
- Robust authentication and encryption mechanisms.## Features
1. **User Registration**
- Users register with a unique username, email, and password.
- Credentials are securely encrypted and stored.2. **User Login**
- Users authenticate with their credentials.
- Credentials are validated securely using hashing and salting.3. **Encrypted Messaging**
- Communication between the client and server is encrypted using AES-128.4. **Security Measures**
- **SHA-256 hashing with salting** for password security.
- **Diffie-Hellman key exchange** for secure session keys.## Key Components
1. **Diffie-Hellman Key Exchange**
- Securely generates and exchanges session keys.2. **Password Security**
- Passwords are hashed with **SHA-256** and unique salts for each user.3. **AES Encryption**
- AES-128 encryption in CBC mode is used for secure message communication.4. **Credential Storage**
- User credentials are securely stored in `creds.txt` as:
```
Email,Username,SHA256_HashedPassword,Salt
```## Prerequisites
- **C++ Compiler** (supporting C++17 or higher).
- OpenSSL (for cryptographic functions).## How to Build and Run
### Steps:
1. Clone the repository:
```bash
git clone https://github.com/Vaneeza-7/Encrypted-Chat-System.git
```2. Compile the server and client files separately:
```bash
g++ -o server server/server.cpp -lssl -lcrypto
g++ -o client client/client.cpp -lssl -lcrypto
```3. Run the server and client in separate terminals:
- Start the server:
```bash
./server
```
- Start the client:
```bash
./client
```## Testing
### Functional Tests
1. **Registration**
- Verify successful registration with unique usernames.
- Confirm passwords are securely hashed and salted.2. **Login**
- Test login with correct and incorrect credentials.3. **Encrypted Chat**
- Ensure all messages are encrypted during transmission.### Security Tests
- Confirm that identical passwords result in different hashes due to salting.
- Use tools (e.g., Wireshark) to verify encryption of communication.---
## License
This project is licensed under the [MIT License](LICENSE).