The DECRYPT function decrypts RAW data by using a stream or block cipher. The cipher uses a key that you provide and an optional initialization vector (IV).
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
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 decrypt. |
| typ | The type of the stream or block cipher. |
| key | The key that is used for decryption. |
| iv | The initialization vector for the cipher block. This parameter is optional. The default value is NULL. |
Considerations
When you call
DECRYPTto retrieve the original plain text RAW data, you must use the same cipher, algorithm, key, and IV as those used for encryption.If
VARCHAR2data is converted to RAW data before it is encrypted, you must use the UTL_I18N package to convert it back to the appropriate database character set.