Loading of Cipher.getInstance taking lot of time

Hi all,

In one of my plugin i need to decrypt some user data and am using Cipher.getInstance(“AES/ECB/PKCS7Padding”, “BC”) for it. What i have observed is, that, the very first call to this takes around 20-30 seconds, the subsequest calls work fine though. Is this because of some class loading issue? I tried it on a stand-alone java program and it works fine, so am pretty sure that it has nothing to do with bouncy castle library. Following is the code to reproduce this:

Security.addProvider(new BouncyCastleProvider());

Cipher decipher = Cipher.getInstance(“AES/ECB/PKCS7Padding”, “BC”);

Put this code in any of the file (I tried putting this in ServerStarter.java file and same result).

Any pointers?

Thanks,

Rana