Skip to content
/ 11780 Public

SecureE2E - Secret line for Secret chats with a VPS

License

Notifications You must be signed in to change notification settings

NIKJOO/11780

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ SecureE2E | فارسی

Note

This project is dedicated to all those who lost their lives during the Iranian National Revolution; those whose names we will remember forever, those whose names will never be spoken, and especially the Unknown Martyr No. 11780.

📖 About

SecureE2E is a client-server chat application where the server acts as a neutral relay. It ensures that even if the server is compromised, your message content remains private.

This project implements a custom cryptographic protocol featuring:

  • Double Ratchet Algorithm: Provides Forward Secrecy and Future Secrecy. Every message uses a unique encryption key.
  • Asymmetric Handshake: Uses Ed25519 for identity signing and Curve25519 for key exchange.
  • Separation of Duties: The Server Password protects access to the network, while the E2E keys protect the content of your messages.

✨ Features

  • 🔒 True End-to-End Encryption: Messages are encrypted on your device and only decrypted on the recipient's device. The server cannot read them.
  • 🔄 Perfect Forward Secrecy: Compromising a long-term key does not decrypt past messages.
  • 🆔 Identity Verification: Each user generates a unique fingerprint. Verify this out-of-band to ensure you aren't being Man-in-the-Middled (MitM).
  • 🛡️ Secure Transport: The connection to the server is secured using AES-256-GCM, derived via Scrypt.
  • 🚫 No Self-Messaging: Logic prevents routing loops and errors by blocking messages sent to oneself.
  • 📜 Message Queuing: If you start typing before the cryptographic handshake is finished, messages are safely queued and sent automatically once the channel is secure.

🔐 Security Architecture

The security model operates in two distinct layers:

  1. Transport Layer (Client ↔ Server) :
    • Purpose: Prevents unauthorized users from connecting to the chat server.
    • Mechanism: Scrypt Key Derivation + AES-256-GCM.
    • Key: Derived from the Server Password.
  2. Application Layer (Client ↔ Client) :
    • Purpose: Ensures only the intended recipient can read the message content.
    • Mechanism: Double Ratchet (X3DH inspired).
  3. Keys :
    • Identity Key: Ed25519.
    • Ephemeral Key: Curve25519.
    • The Ratchet: Both sides maintain a chain key. Sending a message advances the sending chain and derives a unique message key.

📦 Installation

Omptimized for windows OS ( both clien/server ) you need modify it for Linux environments.

Prerequisites

  • Go 1.21+ installed.
  • Terminal access.
  1. Clone the Repository
    git clone https://github.com/yourusername/SecureE2E-Go.git
    cd SecureE2E-Go 
  1. Install Dependencies
    go get golang.org/x/crypto/curve25519
    go get golang.org/x/crypto/ed25519
    go get golang.org/x/crypto/hkdf
    go get golang.org/x/crypto/scrypt
    golang.org/x/crypto/ssh/terminal
    golang.org/x/crypto/argon2
  1. Build
    # Build Server
    go build -o server server.go
    
    # Build Client
    go build -o client client.go

🚀 Usage

Download Video ( can't preview on web ) : (Link).

Follow Me

📄 License Distributed under the MIT License.