Skip to content

A simplified messaging application focused on implementing cryptographic algorithms (ECDH & AES) from scratch.

License

Notifications You must be signed in to change notification settings

GuillaumeDorschner/RTU-CryptoChatApp

Repository files navigation

image

CryptoChatApp

Guillaume Dorschner & Quentin Le Nestour

Introduction

CryptoChatApp is a messaging application demonstrating cryptographic principles implemented from scratch. Without relying on external cryptographic libraries, it explores the fundamentals of Elliptic-curve Diffie–Hellman (asymmetric encryption) for key exchange and AES (symmetric encryption) for message security. Built using React.js and Node.js, the app supports real-time messaging through WebSocket. Refer to the Message Encryption Flow section for detailed cryptographic workflows.

Demo

demo.mp4

Getting Started

Note: This project is for educational purposes and should not be used in production.

Prerequisites

  • Ensure Docker is installed on your system.

Installation

Using Docker

docker pull ghcr.io/guillaumedorschner/rtu-cryptochatapp:latest
docker run -p 80:80 -p 3000:3000 -p 3001:3001 ghcr.io/guillaumedorschner/rtu-cryptochatapp:latest

Then open your browser and visit http://localhost.

Clone the repository

  1. Clone the repository:

    git clone https://github.com/GuillaumeDorschner/CryptoChatApp.git
    cd CryptoChatApp
  2. Start the application with Docker:

    docker compose up
  3. Open your browser and visit http://localhost:3000.

Key Features

  1. ECDH: Used to securely exchange the symmetric AES key between users.
  2. AES: AES ensures message confidentiality by using a symmetric key derived from the ECDH shared secret.
  3. WebSocket: Facilitates real-time encrypted messaging by relaying data between users, without requiring server-side storage of messages.

Message Encryption Flow

The server acts solely as a relay and does not decrypt or store messages.

sequenceDiagram
    participant A as Alice (User)
    participant S as Server
    participant B as Bob (User)

    Note over A,B: Key Exchange Phase
    A->>S: Send ECDH Public Key
    S-->>B: Relay Alice's ECDH Public Key
    B->>S: Send ECDH Public Key
    S-->>A: Relay Bob's ECDH Public Key
    A->>A: Compute Shared Secret with Bob's Public Key
    B->>B: Compute Shared Secret with Alice's Public Key
    A->>A: Derive AES Key from Shared Secret
    B->>B: Derive AES Key from Shared Secret

    Note over A,B: Messaging Phase
    A->>S: Send encrypted message for Bob (via AES)
    S-->>B: Relay encrypted message for Bob (via AES)
    B->>B: Decrypt message using AES
    B->>S: Send encrypted message for Alice (via AES)
    S-->>A: Relay encrypted message for Alice (via AES)

Loading

For a detailed explanation of this project, refer to the Technical Design System.

Cryptographic Concepts

Why Use ECDH?

Elliptic-Curve Diffie-Hellman (ECDH) is chosen for its high security with smaller key sizes compared to RSA or traditional Diffie-Hellman, making it faster and more efficient.
📹 Watch: Elliptic Curve Cryptography Explained

What is AES?

AES (Advanced Encryption Standard) is a symmetric encryption algorithm widely used for its speed and security.
📹 Watch: AES Explained

Common Issues with ECC

ECC, while secure, has implementation challenges and requires careful attention to avoid side-channel attacks.
📹 Watch: Problems with ECC

Learn Cryptographic Basics

For an introduction to public and private key cryptography, check out this beginner-friendly explanation:
📹 Watch: Diffie-Hellman and ECC with Color Analogy

Technology Stack

  • Frontend: React.js
  • Backend: Node.js
  • Real-time Messaging: WebSocket (via ws)
  • Custom Cryptography: ECDH and AES implemented manually.

License

This project is licensed under the MIT License.

About

A simplified messaging application focused on implementing cryptographic algorithms (ECDH & AES) from scratch.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •