Cipher.getInstance is too slow

跟風遠走 提交于 2019-12-13 03:39:12

问题


I have the following line of code that is taking less than a second on my computer (windows 7) and about 20 seconds on a Redhat server :

Cipher cipher = Cipher.getInstance(TRANSFORMATION);

where TRANSFORMATION is defind as :

private static final String TRANSFORMATION = "Blowfish/ECB/PKCS5Padding";

What could be the source of such behaviour ?

Thanks.


回答1:


Initialization of the Bouncy Castle provider and - probably - a slow /dev/random.



来源:https://stackoverflow.com/questions/21757653/cipher-getinstance-is-too-slow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!