Bouncy Castle SCrypt实施是否包括结果中的因素?

时间:2017-08-28 15:17:03

标签: java bouncycastle scrypt

我很确定它没有,但我想确认Bouncy Castle for Java中的SCrypt实现SCrypt.generate()是否包含结果中的参数(就像NodeJS的实现一样)。 / p>

1 个答案:

答案 0 :(得分:2)

没有Bouncy castle在结果中不包含它们,但是如果你想要类似的结果,你可以使用SpringFramework SCrypt。

import org.bouncycastle.crypto.generators.SCrypt;
public static void ScryptSpringFramework()
{   
    public static String plaintextPassword  = "myname123456";
    SCryptPasswordEncoder sEncoder = new SCryptPasswordEncoder();

    String str1 = sEncoder.encode(plaintextPassword);
    System.out.println("SpringFramework output of "+plaintextPassword+" = "+str1);              
}

Here is the link for the SpringFramework crypto.