在bash中将PBKDF2与openssl一起使用而不是php

时间:2019-01-29 17:47:04

标签: openssl cryptography pbkdf2

我在php中有这个脚本,但是我想在bash中使用它。 我不知道我是否可以在openssl中做到这一点,还是必须通过brew安装某些东西。

<?
$password = "army van defense carry jealous true garbage claim echo media make crunch";
$iterations = 2048;
$salt="mnemonic";
$hash = hash_pbkdf2("sha512", $password, $salt, $iterations);
echo $hash;

我尝试过

printf "army van defense carry jealous true garbage claim echo media make crunch" | openssl dgst -sha512 -hmac "mnemonic"

但是我以前没有推导功能

0 个答案:

没有答案