I am implementing a server that contains most of the information the clients have to retrieve. Sensitive information has to be exchanged between client and server, and due to this, I would like to have this information encrypted.
I came up with the idea of encrypting all sensitive information using RSA (PKCS1_OAEP) by having every client and server generating and exchanging their public keys to encrypt, and to be decrypted by the receiver.
What is the catch here? Is it unsafe to do this?
I understand https exists, I am just wondering about this solution.
I understand size is a "limitation", but one way of going around this is encrypting packets, then joining all the packets in a single string to then be decrypted in the same way.