Classes
Methods
(static) cachedPbkdf2(password, objopt) → {Object}
Cached PBKDF2 key derivation.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
password |
String | The password. | |
obj |
Object |
<optional> |
The derivation params (iteration count and optional salt). |
- Source:
Returns:
The derived data in key, the salt in salt.
- Type
- Object
(static) hkdf(ikm, keyBitLength, salt, info, Hashopt) → {bitArray}
HKDF with the specified hash function.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
ikm |
bitArray | The input keying material. | ||
keyBitLength |
Number | The output key length, in bits. | ||
salt |
String | bitArray | The salt for HKDF. | ||
info |
String | bitArray | The info for HKDF. | ||
Hash |
Object |
<optional> |
sjcl.hash.sha256 | The hash function to use. |
Returns:
derived key.
- Type
- bitArray
(static) pbkdf2(password, salt, countopt, lengthopt, Prffopt) → {bitArray}
Password-Based Key-Derivation Function, version 2.0.
Generate keys from passwords using PBKDF2-HMAC-SHA256.
This is the method specified by RSA's PKCS #5 standard.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
password |
bitArray | String | The password. | ||
salt |
bitArray | String | The salt. Should have lots of entropy. | ||
count |
Number |
<optional> |
1000 | The number of iterations. Higher numbers make the function slower but more secure. |
length |
Number |
<optional> |
The length of the derived key. Defaults to the output size of the hash function. | |
Prff |
Object |
<optional> |
sjcl.misc.hmac | The pseudorandom function family. |
Returns:
the derived key.
- Type
- bitArray
(static) scrypt(password, salt, Nopt, ropt, popt, lengthopt, Prffopt) → {bitArray}
scrypt Password-Based Key-Derivation Function.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
password |
bitArray | String | The password. | ||
salt |
bitArray | String | The salt. Should have lots of entropy. | ||
N |
Number |
<optional> |
16384 | CPU/Memory cost parameter. |
r |
Number |
<optional> |
8 | Block size parameter. |
p |
Number |
<optional> |
1 | Parallelization parameter. |
length |
Number |
<optional> |
The length of the derived key. Defaults to the output size of the hash function. | |
Prff |
Object |
<optional> |
sjcl.misc.hmac | The pseudorandom function family. |
Returns:
The derived key.
- Type
- bitArray