Decrypts AES-CBC ciphertext back to plaintext using the same key and IV. A wrong key, IV, or corrupted padding is reported as an error rather than returned as garbage.

Parameters

string
required
The data to decrypt.
string
required
The key used to encrypt.
string
required
The IV used to encrypt.
string
default:"CBC"
The cipher mode. Only “CBC” is supported.

Returns

string
The decrypted data.

Example

Errors