The DECRYPT function decrypts RAW data using a stream cipher or block cipher. The cipher uses the key and optional initialization vector (IV) provided by the user.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_CRYPTO.DECRYPT(
src IN RAW,
typ IN PLS_INTEGER,
key IN RAW,
iv IN RAW DEFAULT NULL)
RETURN RAW;
Parameters
| Parameter | Description |
|---|---|
| src | The RAW data to be decrypted. |
| typ | The cipher stream and cipher block chaining algorithm to be used. |
| key | The key used for decryption. |
| iv | The optional initialization vector for the cipher block. The default value is NULL. |
Considerations
To retrieve the original plaintext data, the same cipher, algorithm, key, and IV used for encryption must be used when calling
DECRYPT.If
VARCHAR2data is converted to RAW data before encryption, the UTL_I18N package must be used to convert it back to the appropriate database character set.
