I am encrypting a message using an hybrid cryptosystem:
I encrypt my message using AES-256 and I encrypt the symmetric cipher key using RSA.

The following questions come to my mind:

  • I want to know if it safe to send the encrypted message with the encrypted key together ?
  • What does it imply for an attacker to get the RSA encrypted key with the encrypted message ?
  • What is the correct way to send the message and the encrypted key ?
  • 1
    $\begingroup$ RSA-KEM-DEM is what you described. Why don't you use ECIES? or ready to use libraries like libsodium? $\endgroup$
    – kelalaka
    Mar 29, 2021 at 18:45

1 Answer 1


Yes it is safe. Assuming you get everything else right(Proper encryption mode), proper padding, secure random key, proper key management and avoid problematic other usages of same key, etc...

You have to provide the encrypted key to the legitimate user, if you have two different transfer systems with independent weaknesses you could transfer separately but that is probably rare and RSA applied properly (e.g OAEP) is sufficient so the encrypted key will reveal nothing about the key to that without the RSA private key.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.