Skip to content

Class: CryptoUtils

Constructors

new CryptoUtils()

new CryptoUtils(): CryptoUtils

Returns

CryptoUtils

Methods

free()

free(): void

Returns

void

Defined in

@nimiq/core/types/wasm/web.d.ts:1069


computeHmacSha512()

static computeHmacSha512(key, data): Uint8Array

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

Parameters

key: Uint8Array

data: Uint8Array

Returns

Uint8Array

Defined in

@nimiq/core/types/wasm/web.d.ts:1084


computePBKDF2sha512()

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

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

Defined in

@nimiq/core/types/wasm/web.d.ts:1095


getRandomValues()

static getRandomValues(length): Uint8Array

Generates a secure random byte array of the given length.

Parameters

length: number

Returns

Uint8Array

Defined in

@nimiq/core/types/wasm/web.d.ts:1075


otpKdf()

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

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>

Defined in

@nimiq/core/types/wasm/web.d.ts:1108