Below is a simple script that whas intened to decode from base64 and decrypt using 3DES
DECLARE
ciphertext VARCHAR2(100) := '\am2cZofWi5vGz3Zk1qzqXcZuLK8Fqso';
l_ovalue RAW(1000);
l_decrypted_data RAW (4000);
key RAW(100) := utl_raw.cast_to_raw('xxx');
BEGIN
l_ovalue := utl_encode.base64_decode(utl_raw.cast_to_raw(ciphertext));
l_decrypted_data := DBMS_CRYPTO.DECRYPT(l_ovalue, dbms_crypto.ENCRYPT_3DES + dbms_crypto.CHAIN_CBC + dbms_crypto.PAD_PKCS5 , key);
dbms_output.put_line('dec STR='||UTL_RAW.CAST_TO_VARCHAR2(l_decrypted_data));
END;
Error trace:
[2021-11-15 00:39:45] [99999][28817]
[2021-11-15 00:39:45] ORA-28817: PL/SQL function returned an error.
[2021-11-15 00:39:45] ORA-06512: at "SYS.DBMS_CRYPTO_FFI", line 67
[2021-11-15 00:39:45] ORA-06512: at "SYS.DBMS_CRYPTO", line 44
[2021-11-15 00:39:45] ORA-06512: at line 9
[2021-11-15 00:39:45] Position: 0
What is the reason of this error and how to fix it?