问题描述
2019 年更新:Bouncycastle 现在支持 PBKDF2-HMAC-SHA256,因为 bouncycastle 1.60
对于 JAVA 是否有可靠的 PBKDF2-HMAC-SHA256 实现?
Is there any reliable implementation of PBKDF2-HMAC-SHA256 for JAVA?
我曾经使用 bouncycastle 加密,但它不提供 PBKDF2WithHmacSHA256'.
I used to encrypt using bouncycastle but it does not provide PBKDF2WithHmacSHA256'.
我不想自己写加密模块.
I do not want to write crypto module by myself.
您能否推荐任何替代库或算法(如果我可以坚持使用 bouncycastle)
Could you recommend any alternative library or algorithm (if i can stick with bouncycastle)
(这里是 bouncycastle 支持的算法)http://www.bouncycastle.org/specifications.html
(here are the algorithms that bouncycastle supports) http://www.bouncycastle.org/specifications.html
推荐答案
直接使用 BouncyCastle 类:
Using BouncyCastle classes directly:
PKCS5S2ParametersGenerator gen = new PKCS5S2ParametersGenerator(new SHA256Digest());
gen.init("password".getBytes("UTF-8"), "salt".getBytes(), 4096);
byte[] dk = ((KeyParameter) gen.generateDerivedParameters(256)).getKey();
这篇关于PBKDF2-HMAC-SHA256 for JAVA 的可靠实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)