phpencryptionrsajcryption

Faster RSA library than the one used in jCryption?


Is there a faster RSA algorithm than the one used in jCryption (http://www.jcryption.org/)? I only need the decryption part of the library, if that helps. Also my RSA keys are in integer format, and the cipertext is in HEX format. The reason why i want a faster library, is that the one i've already got, spends a whopping 3.4 seconds to do the decryption. I'm using PHP.

Thanks in advance.


Solution

  • You not only want a faster, but also a secure implementation of RSA in PHP: phpseclib's Crypt_RSA is what you want if you absolutely must be doing RSA in PHP, since it implements OAEP (jCryption only implements plain, insecure textbook RSA which is not semantically secure and vulnerable to a number of cryptanalytical attacks).

    But chances are, that if you are rolling your own cryptosystem using RSA in PHP, you are doing something wrong in the first place...