0% found this document useful (0 votes)
107 views1 page

Decrypt

The function decrypts an encrypted string using the DES algorithm with a hardcoded key. It takes an encrypted string as input, decrypts it using the key and DES decryption, and returns the decrypted raw string. It also defines and ignores exceptions that could occur during the decryption process.

Uploaded by

jigar soni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views1 page

Decrypt

The function decrypts an encrypted string using the DES algorithm with a hardcoded key. It takes an encrypted string as input, decrypts it using the key and DES decryption, and returns the decrypted raw string. It also defines and ignores exceptions that could occur during the decryption process.

Uploaded by

jigar soni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--select TEXT from user_source where name='DECRYPT';

function decrypt(encrypted_raw IN VARCHAR2)

return varchar2 IS

decrypted_raw RAW(2048);
decrypted_string VARCHAR2(2048);

key_string VARCHAR2(16) := 'keepthesecretnum';


raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(key_string);

decrypted_string VARCHAR2(2048);
error_in_input_buffer_length EXCEPTION;

PRAGMA EXCEPTION_INIT(error_in_input_buffer_length, -28232);


INPUT_BUFFER_LENGTH_ERR_MSG VARCHAR2(100) :=
'*** DES INPUT BUFFER NOT A MULTIPLE OF 8 BYTES - IGNORING EXCEPTION ***';
double_encrypt_not_permitted EXCEPTION;
PRAGMA EXCEPTION_INIT(double_encrypt_not_permitted, -28233);
DOUBLE_ENCRYPTION_ERR_MSG VARCHAR2(100) :=
'*** CANNOT DOUBLE ENCRYPT DATA - IGNORING EXCEPTION ***';

BEGIN
dbms_obfuscation_toolkit.DESDecrypt(input => encrypted_raw,
key => raw_key, decrypted_data => decrypted_raw);

RETURN decrypted_raw;

END;

You might also like