Secure Group Chat application using java remote method invokation.
Each client is considered a server which apply Peer to Peer communication without the need to implement a server to handle the communications between all the clients. Each client send their certficates to the newly joined clients to the chat group and aggree to create a shared session key only between them. Using the newly created session key, all the communication between all the clintes should be encrypted.
-
Sender and receiver should have self signed certificate then exchange the certificates (using RSA or ECC) in order to verify their identities.
-
It is required to have (diffie Hellman) agreement to get shared secret session key between the entities after verifying their identities.
-
Use the acquired session keys to create a cipher eg; DES, AES, etc..
-
Encrypt/Decrypt the messages using the created cipher.
- Goal was achived using created CertificateGenerator object.
- ECC keys were created using bouncy castle security library.
-
Goal was achived using the created DHKeyGenerator object.
-
& 4. Goals were achived using the created EncryptDecrypt object.
-
Import the project to netbeans/Eclipse whatever IDE you're using
-
Add bouncy castle library you will find it under /dist/lib/bcprov-jdk15on-161.jar
-
In Main.java line 22 change it to 0 then run the main java file, then change it to 1 and run it again. Keep doing this step till you reach the last number in java interface NodeI.java variable numberOFNodes -1
You can change the numberOFNodes in the interface and add more clients to be instantiated for example:
If you want to add one more client to be total of 4 clients, You will have to edit the interface class NodeI.java only.
- numberOFNodes -> 4
- ipAddr -> {"127.0.0.1", "127.0.0.1", "127.0.0.1", "127.0.0.1"};
- services -> {"Alice", "Bob", "Larry", "Carol"};
- ports -> {2000, 3000, 4000, 5000};
Note that, when you run the java file for that specific client for example Alice which run on localhost:2000 you might get registery exception because there is another service on your pc use the same port 2000. So all what you have to do is to change 2000 to any port number in the NodeI.java
- Got to Node.java at line 46 change mAlgorithm to -> "ECC" or "RSA" then run the client after that change. Keep in mind you can run multiplte clients with diffrent certficate signing algorithms, for example run Client 0 which is alice with ECC then go edit lint 46 to run BOB which is client 1 with RSA and both can change cerfticates and will be able to verfiy and see it's contents.