Search code examples
javaencryptionrsabouncycastle

Bouncycastle - Native RSA vs. RSA


There are two different ciphers in the Bouncy Castle crypto library that you can pass to PKCS1Encoding: NativeRSAEngine and RSAEngine. Is there a difference between these two variants?

Edit:

As Maarten pointed out in his comment, NativeRSAEngine is not part of the Bouncy Castle library itself; it is an addition to the Bouncy Castle lightweight API.


Solution

  • Yes. NativeRSAEngine is implemented with a native library, while RSAEngine is written entirely in Java. As for which is faster, there is a comment on that NativeRSAEngine Javadoc that says this is much faster using jna-gmp.