bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
230 stars 121 forks source link

RSAPrivateKey totient function (issue/question) #207

Open andry-brill opened 10 months ago

andry-brill commented 10 months ago

Now

In api.dart uses Euler totient function to calculate _pubExp in RSAPrivateKey.

But

Most modern implementations of RSA generators apply the Carmichael totient function lcm(p - 1, q - 1).

And when I'm generating RSAPrivateKey outside of the pc-dart calculated _pubExp != original.

More details in question on stackoverflow

Not expert in security, so I don't know consequences, but from development's side it feels strange.