I will be using CSE for a web application as follows.
- Generate a random AES key
- Encrypt the cleartext data with this AES key
- Encrypt the AES key with the service's public key, using RSA
Obviously, all that will happen over SSL. I purposely skipped the process of how I retrieve the service's public key.
1) Is this algorithm secure? I assume it is because it seems to be the standard. Assuming of course you are correctly using AES and using a RSA key of a proper length.
2) I know that when encrypting a message using RSA, a padding algorithm such as RSA-OAEP should be used to add randomness to the message. But since in this case the message is random (it is the randomly generated AES key), is the padding algorithm still necessary / useful? If yes, why? Assuming here that the randomly generated AES key is random enough.
Thanks!