简体   繁体   中英

openssl create Pbkdf2 key derivation

I want to derivate a hashed password using the Pbkdf2 algorithm.

Input: Password, Salt, HashAlgorithm, IterationCount
Output: Hash

How to perform this with the openssl command line? I foundhttps://www.openssl.org/docs/manmaster/man7/EVP_KDF-PBKDF2.html , so openssl should be able to do it, but I cannot find any docs on which command line to use.

You can use the OpenSSL "kdf" app to do this. You will need OpenSSL 3.0 for this (that app is not available in earlier versions).

See the man page here: https://www.openssl.org/docs/man3.0/man1/openssl-kdf.html

Example:

$ openssl kdf -keylen 32 -kdfopt digest:SHA256 -kdfopt pass:password -kdfopt salt:salt -kdfopt iter:10000 PBKDF2
5E:C0:2B:91:A4:B5:9C:6F:59:DD:5F:BE:4C:A6:49:EC:E4:FA:85:68:CD:B8:BA:36:CF:41:42:6E:88:05:52:2B

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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