0

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?

0x6B6F77616C74
  • 2,559
  • 7
  • 38
  • 65
  • perhaps this us this from the very start, ie, original string to encrypted so we can compare to your decryption above – Connor McDonald Nov 15 '21 at 03:58
  • 28817. 00000 - "PL/SQL function returned an error." *Cause: A PL/SQL function returned an error unexpectedly. *Action: This is an internal error. Enable tracing to find more information. Contact Oracle customer support if needed. – astentx Nov 15 '21 at 06:09
  • @ConnorMcDonald Is it is possible for wrong decryption input string to yield a stack trace? – 0x6B6F77616C74 Nov 15 '21 at 08:39

0 Answers0