The purpose of this example is to show how you encrypt / decrypt message with public / private key known as RSA encryption and how to generate common key without transferring it over the network (Diffie-Hellman algorithm).
Encryption of data is very important this days. In this repository you can find two working examples of encryption and key generation with java technology.
First example named RSAEncryptionExample.java contain this:
- Generating of key-pair (public and private key)
- Encryption of message
- Decryption of message
Second example named Diffie-Hellman contain explanation how to use algorithm, to generate common key between two parties without actually transferring the key. The secret of this algorithm is that from public key of other party and you private key you can generate common secret key, which is both for you and other party.
This example can be found here:
Author of this example is: https://github.com/firatkucuk