Initial commit
[yaffs-website] / node_modules / bcrypt-pbkdf / README.md
1 Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified
2 version of [Devi Mandiri's port]
3 (https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js),
4 with some minor performance improvements. The code is copied verbatim (and
5 un-styled) from Devi's work.
6
7 This product includes software developed by Niels Provos.
8
9 ## API
10
11 ### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)`
12
13 Derive a cryptographic key of arbitrary length from a given password and salt,
14 using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and
15 SHA-512.
16
17 See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for
18 further information.
19
20 Parameters:
21
22  * `pass`, a Uint8Array of length `passlen`
23  * `passlen`, an integer Number
24  * `salt`, a Uint8Array of length `saltlen`
25  * `saltlen`, an integer Number
26  * `key`, a Uint8Array of length `keylen`, will be filled with output
27  * `keylen`, an integer Number
28  * `rounds`, an integer Number, number of rounds of the PBKDF to run
29
30 ### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)`
31
32 Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as
33 part of the inner round function in the PBKDF.
34
35 Parameters:
36
37  * `sha2pass`, a Uint8Array of length 64
38  * `sha2salt`, a Uint8Array of length 64
39  * `out`, a Uint8Array of length 32, will be filled with output