Cipher.getInstance太慢了 [英] Cipher.getInstance is too slow

查看:2042
本文介绍了Cipher.getInstance太慢了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一行代码在我的电脑(Windows 7)上耗时不到一秒,而在Redhat服务器上耗时不到20秒。

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);

其中TRANSFORMATION被定义为:

where TRANSFORMATION is defind as :

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

这种行为的来源可能是什么?

What could be the source of such behaviour ?

谢谢。

推荐答案

Bouncy Castle提供商的初始化和 - 可能 - 一个缓慢的 / dev / random

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

这篇关于Cipher.getInstance太慢了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆