Generate RSA keys using public exponent 65537 (was 17)
authorIvo Smits <Ivo@UCIS.nl>
Sat, 14 May 2016 13:05:52 +0000 (15:05 +0200)
committerIvo Smits <Ivo@UCIS.nl>
Sat, 14 May 2016 13:05:52 +0000 (15:05 +0200)
OpenSSL and the MS RSA CSP (Win7 x64) generate RSA keys with a public exponent of 65537. Smaller public exponents are not allowed by some specifications and may be rejected by other software.

mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs

index 7240fa548094b57bcb9c7068fc616ff4423ef8d0..17648d708696c16f28d08ab397cfdd81dbdd7eae 100644 (file)
@@ -93,7 +93,7 @@ namespace Mono.Security.Cryptography {
                        // p and q values should have a length of half the strength in bits
                        int pbitlength = ((KeySize + 1) >> 1);
                        int qbitlength = (KeySize - pbitlength);
-                       const uint uint_e = 17;
+                       const uint uint_e = 65537;
                        e = uint_e; // fixed
        
                        // generate p, prime and (p-1) relatively prime to e