@nimiq/core / CryptoUtils
Class: CryptoUtils
Defined in: @nimiq/core/types/wasm/web.d.ts:1136
Methods
[dispose]()
[dispose]():
void
Defined in: @nimiq/core/types/wasm/web.d.ts:1139
Returns
void
free()
free():
void
Defined in: @nimiq/core/types/wasm/web.d.ts:1138
Returns
void
computeHmacSha512()
staticcomputeHmacSha512(key,data):Uint8Array
Defined in: @nimiq/core/types/wasm/web.d.ts:1149
Computes a 64-byte HMAC-SHA512 hash from the input key and data.
Parameters
key
Uint8Array
data
Uint8Array
Returns
Uint8Array
computePBKDF2sha512()
staticcomputePBKDF2sha512(password,salt,iterations,derived_key_length):Uint8Array
Defined in: @nimiq/core/types/wasm/web.d.ts:1155
Computes a PBKDF2-over-SHA512 key from the password with the given parameters.
Parameters
password
Uint8Array
salt
Uint8Array
iterations
number
derived_key_length
number
Returns
Uint8Array
getRandomValues()
staticgetRandomValues(length):Uint8Array
Defined in: @nimiq/core/types/wasm/web.d.ts:1143
Generates a secure random byte array of the given length.
Parameters
length
number
Returns
Uint8Array
otpKdf()
staticotpKdf(message,key,salt,iterations):Promise<Uint8Array<ArrayBufferLike>>
Defined in: @nimiq/core/types/wasm/web.d.ts:1163
Encrypts a message with an OTP KDF and the given parameters. The KDF uses Argon2d for hashing.
Parameters
message
Uint8Array
key
Uint8Array
salt
Uint8Array
iterations
number
Returns
Promise<Uint8Array<ArrayBufferLike>>