java MainChat localhost 1234 localhost 1235
java MainChat localhost 1235 localhost 1234
java MainChat hostA 1234 hostB 1235
java MainChat hostB 1235 hostA 1234
- We used this project as a starting point. There is no encryption though, so everything going through the network is in plain text.
- As the application is supposed to be point to point, we removed the server and the logic to manage multiple clients. We focused on having a connection that allowed two clients to exchange messages in plain text.
- When we accomplished the above objective, we introduced the Diffie-Hellman algorithm to exchange a secret key.
- Finally, we used the key to encrypt and decrypt all the messages of the communication using AES-128.
The program was tested and is known to work with two computers in the same network.
It is relatively easy to create a secure chat using the built-in encryption libraries in the JDK. The security of the application depends on the size of the prime number P.