# Symmetric encryption using RSA for random generated password

I'm fairly new to encryption, so I wanted to check the logic for a .net solution I'm working on that encrypts data between two parties. the receiving (decrypting) party will have an RSA key pair stored. They will transmit the public key to the encrypting party via a web service call. The encrypting party will use the public key to encrypt a random generated password. Prior to the RSA encryption, this password will be used to derive the Key/IV (using Rfc2898DeriveBytes) for RijndaelManaged symmetric encryption for the main data.

The RSA-encrypted password will be transmitted along with the RijndaelManaged-encrypted data via another web service call. The receiving party will decrypt the RSA password using their private RSA key. They will then use the password to decrypt the RijndaelManaged-encrypted data.

The thinking is that the use of the random password will avoid the pitfalls of storing a constant password if I were to only use symmetric encryption. It also provides for a different key/IV each time as well as a different RSA key each time. The reason I'm thinking of this Symmetric/Asymmetric hybrid approach is after reading about some of the performance pitfalls of just using RSA. My question is whether this is any better or worse than going with one encryption method or the other, or if I'm missing something that will make this approach impossible or open me up to some sort of vulnerability.

• The method is insecure unless the encrypting party has some way (currently unstated) to verify that the public key used for encryption matches the private key of the intended decrypting party. Also, there is no attempt to authenticate the origin of the data that the decrypting party will obtain.
– fgrieu
Nov 17, 2015 at 18:25
• No. An attacker could generate a public/private key pair, then do just the same.
– fgrieu
Nov 17, 2015 at 19:37
• Nope. Known solutions involve transmitting the decrypting party's public key over a channel assumed to offer integrity; reading a hash of that public key over such a channel; trusting a third party to certify the decrypting party's public key.
– fgrieu
Nov 17, 2015 at 21:09
• What's proposed in the question has at least an advantage over symmetric encryption: it is safe against passive eavesdropping of exchanges.
– fgrieu
Nov 18, 2015 at 5:42
• Why are you using passwords at all? You could encrypt the key (and optionally the IV) with RSA. Nov 18, 2015 at 11:13