Skip to main content

encrypt

talawa-apiDocs


talawa-api / utilities/PII/encryption / encrypt

Function: encrypt()

> encrypt(text, key, iv): string

Encrypts plaintext using AES-256-CBC encryption.

Parameters

text: string

The plaintext to encrypt.

key: string

The encryption key as a string.

iv: string

The initialization vector (IV) as a string in hexadecimal format.

Returns

string

The encrypted ciphertext as a hexadecimal string.

Defined in

src/utilities/PII/encryption.ts:10