示例#1
0
 public static byte[] computeSeedFromSaltAndPassword(String salt, String password) {
   try {
     byte[] seed =
         SCrypt.scrypt(
             CryptoUtils.decodeAscii(password),
             CryptoUtils.decodeAscii(salt),
             SCRYPT_PARAMS_N,
             SCRYPT_PARAMS_r,
             SCRYPT_PARAMS_p,
             SEED_LENGTH);
     return seed;
   } catch (GeneralSecurityException e) {
     throw new TechnicalException("Unable to salt password, using Scrypt library", e);
   }
 }