This Java-based chat application allows two clients to communicate securely via LAN or Wi-Fi using RSA encryption. The server facilitates connections but cannot decipher messages between clients.
- End-to-end encryption using RSA.
- Secure chat between two clients.
- Multithreaded server capable of handling multiple connections.
- Java 8 or higher.
- LAN or Wi-Fi for offline communication.
java.net.*
- Networking interface for sockets.java.io.*
- Stream handling.java.math.BigInteger
- Handles large integers for RSA encryption.java.util.Random
- For prime number generation in RSA.
-
Clone or download the repository:
git clone https://github.com/ronaessi-28/Multithreaded-end-to-end-encryption-chatting-system-.git
-
Navigate to the project folder:
cd Multithreaded-end-to-end-encryption-chatting-system-
-
Compile all Java files:
javac *.java
-
First, run the
Server.java
:java Server
-
On separate systems, run
Client.java
for each client:java Client
-
Input the server IP and port (default: 42000), then enter your name.
-
Start chatting securely!
This project uses socket programming for communication between clients and RSA encryption to secure messages. Each client connects to the server, which facilitates message exchange without the ability to decrypt the content.
For RSA, two large prime numbers are generated, and keys are created. The public key is used to encrypt messages, and the private key decrypts them, ensuring end-to-end encryption.