PDA

View Full Version : Encryption Problem


bobthe
03-09-2010, 12:30 AM
I get the error below when trying to encrypt a string in PHP. I have verified that both the cipher and mode are available options in Quercus. The cipher is MCRYPT_RIJNDAEL_256 and the mode is MCRYPT_MODE_ECB. I am unsure what the "no padding" piece means at the moment (is that the problem?) At this point I'm trying to identify what could potentially be the source of the problem. I have no worked with encryption in Quercus before, let alone even done much with encryption in the past.

java.lang.RuntimeException: java.security.NoSuchAlgorithmException: Cannot find any provider supporting Rijndael256/ECB/NoPadding

emil
03-10-2010, 07:09 PM
Hi bobthe,

You probably just want Rijndael 128, which is AES. As background, Rijndael 256 was one of the modes described when the algorithm was first published, but it was not standardized. mcrypt (the library from which PHP gets its encryption) did implement this mode, but it was never implemented in standard Java encryption libraries (which we use) because it's not codified in any standard.

Take care,
Emil