You are looking at historical revision 36644 of this page. It may differ significantly from its current revision.

PBKDF2

Description

Password-Based Key Derivation Function 2 as defined in RFC2898

Author

Tobias Heilig <off_world at gmx . de>

Repository

https://github.com/off-world/pbkdf2

Requirements

*hmac *sha1 *sha2

API

Common Argument Definitions

result-type
'string
return resulting bytes as a byte-string
'hex
return resulting bytes as a string of lower-case hexadecimal digits
'blob
return resulting bytes as a blob
'u8vector
return resulting bytes as a u8vector
password

password as a string

salt

salt as a string

count

iteration count as a positive exact integer

dklen

length in bytes of the derived key as a positive exact integer

Procedures

pbkdf2-hmac-sha1
[procedure] (pbkdf2-hmac-sha1 password salt count dklen #!optional (result-type 'blob)
pbkdf2-hmac-sha256
[procedure] (pbkdf2-hmac-sha256 password salt count dklen #!optional (result-type 'blob)
pbkdf2-hmac-sha384
[procedure] (pbkdf2-hmac-sha384 password salt count dklen #!optional (result-type 'blob)
pbkdf2-hmac-sha512
[procedure] (pbkdf2-hmac-sha512 password salt count dklen #!optional (result-type 'blob)

Examples

(use pbkdf2)
(pbkdf2-hmac-sha1 "password" "salt" 4096 20)
'';=> #${4b007901b765489abead49d926f721d065a429c1}''
(pbkdf2-hmac-sha1 "password" "salt" 4096 20 'hex)
'';=> "4b007901b765489abead49d926f721d065a429c1"''

License

Copyright (c) 2018, Tobias Heilig
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. The name of the authors may not be used to endorse or promote products
   derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Version History

1.0
initial release