Skip to content

decrypt

decrypt(input, ciphertext): string

Defined in: packages/core/src/utils/encrypt.ts:59

Decrypt a value produced by encrypt, trying the current key first and then the previous one (the rotation fallback).

SecretInput

Server secret, or the current/previous pair during a rotation.

string

Encrypted payload in iv:tag:ciphertext (base64url) format.

string

The original plaintext secret.

If no secret is configured, the payload is malformed, or no key decrypts it.