I am trying to build an android chat application just for educational purpose. I would like to try implementing end-to-end encryption so that my messages are secure. I thought of using RSA as the encryption scheme (I'm new to the field of cryptography)
This is how I thought I should do it,
Step 1: Generate public and private key in the Client and Server sides.
Step 2: Exchange the public keys. (This means that server will have the public key of each and every client).
Step 3: Encrypt the message using the public key of the Server and send to Server or vice-versa.
Step 4: The Server can then use its private key to decrypt the message.
So my questions are,
- How am I to store the private keys?
- What are the drawbacks of this approach?
- How should this actually be implemented?
Please help me clear this concept