I use RijndaelManaged
to encrypt files, using > (RM) I am using> RM How to encrypt the file by generating Key and IV in GenerateKey
and RM.GenerateIV
and using the CryptoStream
class. I am planning to save this key and IV in a file and want to make sure that I am doing it correctly. I'm combining IV + key, and encrypting with my RSA public key and writing it in a file. After that, to decrypt I use the RSA private key on this file to get the IV + key, and I separate the RM for these values. Let's set up RMVI and run decryptter.
Is this the best way to accomplish this, or is there any preferred way to save and save; Key?
This general idea is that the fourth is not necessary to be kept secret, though. Only "secret key" is the secret.
You may consider using standard / SIEM (or its underlying cryptographic message syntax) for your file format. I'm not sure that Bouncycastle has placed its S / MIME (or PGP) libraries in .NET, or if there is a built-in support for S / MIME in .NET, but there is a possibility of a free library available for your platform. In this way, a widely used open source library has been tested and tested, which you can do automatically, and apply the protocols created by experts in cryptography, so you are not surprised. What should I do?
The model key exchange described by you is similar to S / MIMEE's "Kitron Reciprint Info" method. A symmetric key is generated to encrypt the data, then that key is encrypted with the public key of each intended recipient. Encrypted keys and IV (which are not encrypted in this standard) are bundled with information about the algorithms used in the CMS structure. Encrypted data can be included in the same bundle, or may be in a different file.
The PGP is a mode that is essentially equal.
Comments
Post a Comment