Module with synchronous cryptographic functions
- Source:
- Tutorials:
Methods
(inner) hash(data, lentghopt, algorithmopt) → {string}
Basic hashing function
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
string | data to hash |
|
lentgh |
number |
<optional> |
output length in octets |
algorithm |
string |
<optional> |
hash algorithm |
- Source:
Returns:
hexadecimal representation of the hash
- Type
- string
(inner) hkdf(ikm, salt, info, keylen) → {buffer}
Hash-based Key Derivation Function using SHA-256 i.a.w. RFC 5869
Parameters:
Name | Type | Description |
---|---|---|
ikm |
buffer | input key material |
salt |
buffer | salt |
info |
buffer | info |
keylen |
buffer | output key length in octets |
- Source:
Returns:
generated key
- Type
- buffer
(inner) zeroise(buffer) → {buffer}
Basic zeroisation function
Parameters:
Name | Type | Description |
---|---|---|
buffer |
buffer | buffer to zeroise |
- Source:
Returns:
the zeroised buffer
- Type
- buffer