简体   繁体   English

不能与Bouncy Castle fips jar一起使用PBEWithHmacSHA1AndDESede,可以与RSA cryptoJ一起正常工作

[英]Can't use PBEWithHmacSHA1AndDESede with Bouncy Castle fips jar, works fine with RSA cryptoJ

I have a code that creates a key using algorithm PBEWithHmacSHA1AndDESede 我有一个使用算法PBEWithHmacSHA1AndDESede创建密钥的代码

SecretKeyFactory.getInstance("PBEWithHmacSHA1AndDESede");

The above works fine with RSA JSAFE JCE but doesnot with BouncyCastle Fips Jar. 上面的方法可以与RSA JSAFE JCE一起使用,但不能与BouncyCastle Fips Jar一起使用。

What would be the algorithm for bouncycastle that matches PBEWithHmacSHA1AndDESede of RSA? 与RSA的PBEWithHmacSHA1AndDESede匹配的Bouncycastle的算法是什么?

PBEWithHmacSHA1AndDESede translates to DESede/CBC/PKCS5Padding cipher with secret key created with PBKDF2withHmacSHA1 PBEWithHmacSHA1AndDESede转换为DESede/CBC/PKCS5Padding具有使用PBKDF2withHmacSHA1创建的密钥的DESede/CBC/PKCS5Padding密码

SecretKeyFactory kf = SecretKeyFactory.getInstance(
    "PBKDF2withHmacSHA1", "BCFIPS");

Cipher c = Cipher.getInstance("DESede/CBC/PKCS5Padding", "BCFIPS");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM