Encrypting Files with AES, Encrypting Key with RSA - Am I on the right track?

Posted by Shawn Steward on Stack Overflow See other posts from Stack Overflow or by Shawn Steward
Published on 2010-05-13T18:37:46Z Indexed on 2010/05/13 18:44 UTC
Read the original article Hit count: 367

Filed under:
|
|
|
|

Overview: I'm trying to design an application that will encrypt files to safely send through the mail. I'm planning on using AES/RijndaelManaged encryption from .Net to encrypt the files initially, using a randomly generated key using RNGCryptoServiceProvider. I'm then encrypting this random AES key with a RSA Public key. The receiver of the data is the only one with the RSA Private key to decrypt it.

My question: Is this the proper way to do something like this? If so, is it safe to send this RSA-Encrypted key with the data since it requires the private key to decrypt?

Also - when having the end user generate their Public/Private key pair, what is the best way to save the Private key? I do not want it to be only accessible from one machine, so I am trying to avoid using the user's key store. But MSDN says it is not safe to save the key to a file, so how else can you accomplish this?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about encryption