I have been provided with M, Exponent and D components of and RSA parameter and have been trying to encrypt data using it in C#.NET. I was wondering as parts of public key which of these components are necessary to have to encrypt data? Also, the exponent is 10001 in base 16. What should I set the RsaParameters.Exponent parameter in C#? I don't know how exactly I should interpret that number and place it in Exponent which is a byte array. Don't the components need to have an even length in base 16?
Thanks.
RSAParameters rsaKeyInfo = new RSAParameters
{
Exponent = new byte[] {1, 0, 1},
...
};
using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
{
rsa.ImportParameters(rsaKeyInfo);
rsa.Decrypt(...)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With