Skip to main content

decrypt

@quik/core


@quik/core / decrypt

Function: decrypt()

decrypt(text): string

Defined in: utils/Crypto.ts:75

Decrypts a payload generated by encrypt.

The input must be the base64-encoded payload returned by encrypt, including the serialized cipher text, initialization vector, and auth tag.

Parameters​

text​

string

Encrypted payload to decrypt.

Returns​

string

Throws​

MissingAppKeyError If crypto.appKey is not configured.

Throws​

Error If the payload is malformed or authentication fails.

Example​

const encrypted = encrypt("hello");
const plainText = decrypt(encrypted);

See​

encrypt For the companion encryption method.