I have to create a Client-Server Application using Java and I want to make the communication secure. I thought to use AES to encrypt the messages and for key exchange I make the next steps:
- Client generates RSA keys and send public key to server
- Server will encrypt the AES key with RSA Public key (AES key is generated random for every client)
- Client decrypt the message with its RSA Private key and then all messages will be encrypted with AES
My question is: is it a good practice ?