How do i generate random data with RSA?

Posted by acidzombie24 on Stack Overflow See other posts from Stack Overflow or by acidzombie24
Published on 2010-06-14T08:02:03Z Indexed on 2010/06/14 23:32 UTC
Read the original article Hit count: 137

Filed under:
|
|
|

After loading my RSACryptoServiceProvider rsa object i would like to create a key for my AES object. Since i dont need to store the AES key (i only need it to decrypt on my prv side) i figure i dont need to store it and i can generate it with my public key.

I thought doing rsa.Encrypt(byte[] with 4 hardcoded bytes); would generate the data i need. It turns out everytime i call this function even with the same data i get different results. So theres no way for me to recreate the AES key if its different everytime.

How can i generate data with RSA in a way that i can recreate anytime i need?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about random-number-generator