Skip to content

Class: CryptoUtils

Defined in: @nimiq/core/types/wasm/web.d.ts:1019

Methods

free()

free(): void

Defined in: @nimiq/core/types/wasm/web.d.ts:1021

Returns

void


computeHmacSha512()

static computeHmacSha512(key, data): Uint8Array

Defined in: @nimiq/core/types/wasm/web.d.ts:1031

Computes a 64-byte HMAC-SHA512 hash from the input key and data.

Parameters

key

Uint8Array

data

Uint8Array

Returns

Uint8Array


computePBKDF2sha512()

static computePBKDF2sha512(password, salt, iterations, derived_key_length): Uint8Array

Defined in: @nimiq/core/types/wasm/web.d.ts:1037

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()

static getRandomValues(length): Uint8Array

Defined in: @nimiq/core/types/wasm/web.d.ts:1025

Generates a secure random byte array of the given length.

Parameters

length

number

Returns

Uint8Array


otpKdf()

static otpKdf(message, key, salt, iterations): Promise<Uint8Array>

Defined in: @nimiq/core/types/wasm/web.d.ts:1045

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>