Skip to content
Secure Group Chat application
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


Secure Group Chat application using java remote method invokation.

Project description

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.

Project Goals

  1. Sender and receiver should have self signed certificate then exchange the certificates (using RSA or ECC) in order to verify their identities.

  2. It is required to have (diffie Hellman) agreement to get shared secret session key between the entities after verifying their identities.

  3. Use the acquired session keys to create a cipher eg; DES, AES, etc..

  4. Encrypt/Decrypt the messages using the created cipher.

Goals achieved

  1. Goal was achived using created CertificateGenerator object.
  • ECC keys were created using bouncy castle security library.
  1. Goal was achived using the created DHKeyGenerator object.

  2. & 4. Goals were achived using the created EncryptDecrypt object.

How to run:

  1. Import the project to netbeans/Eclipse whatever IDE you're using

  2. Add bouncy castle library you will find it under /dist/lib/bcprov-jdk15on-161.jar

  3. In 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 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 only.

Go to edit the following:

  • numberOFNodes -> 4
  • ipAddr -> {"", "", "", ""};
  • 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

How to change certficate signing algorithm:

  • Got to 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.
You can’t perform that action at this time.