We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK版本: openjdk_8_201 hutool版本: 5.8.9(请确保最新尝试是否还有问题)
final SM2 sm2 = SmUtil.sm2("xxxxxx", "xxxxx"); // 加入这段代码之后 加密时间由1000ms变为几十ms SecureUtil.generateKeyPair("SM2"); // 公钥加密,私钥解密 long t1 = System.currentTimeMillis(); byte[] encrypt = sm2.encrypt(StrUtil.bytes("我是一段测试aaaa", CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey); long t2 = System.currentTimeMillis(); System.out.println(t2-t1); byte[] decrypt = sm2.decrypt(encrypt, KeyType.PrivateKey); Assert.assertEquals("我是一段测试aaaa", StrUtil.str(decrypt, CharsetUtil.CHARSET_UTF_8));
加入以下代码为什么会变快呢? SecureUtil.generateKeyPair("SM2");
The text was updated successfully, but these errors were encountered:
原因来自Linux下随机种子生成的问题。
可以搜下相关内容,修改为非阻塞方式。
Sorry, something went wrong.
No branches or pull requests
版本情况
JDK版本: openjdk_8_201
hutool版本: 5.8.9(请确保最新尝试是否还有问题)
问题描述(包括截图)
加入以下代码为什么会变快呢?
SecureUtil.generateKeyPair("SM2");
The text was updated successfully, but these errors were encountered: