Post
Topic
Board Development & Technical Discussion
How do I calculate the Exponent for public/private keys
by
Anti-Cen
on 30/01/2018, 11:25:38 UTC
I am using Microsoft Windows RSACryptoServiceProvider just to generate the keys for now but it also calculates the Exponent
at the same time and I want to cut RSACryptoServiceProvider out of the loop so I am doing encryption/decryption with BigInt
which I have got working just fine.

strange thing is the keys keep changing with RSACryptoServiceProvider but the Exponent always stays as "AQAB" on a 512 bit key
and unless you set PersistKeyInCsp = false; then the key pairs get saved by spy-master general  so basically just don't trust Microsoft one bit here

The code I use for now in C# to create keys/Exponent is shown below

Quote
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(512);  // Key bits length
 rsa.PersistKeyInCsp = false;
 RSAParameters RParams = rsa.ExportParameters(true);
 this.PublicAddress = Convert.ToBase64String(RParams.Modulus);
 this.PrivateAddress = Convert.ToBase64String(RParams.D);
 this.Exponent = Convert.ToBase64String(RParams.Exponent);
 this.KeySize = rsa.KeySize;

Later I want to generate my own key pairs and compress the size of the public key down without using a million lines of code