Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is it possible to decrypt a Winzip file in the Oracle database using DBMS_CRYPTO?

user8996918Mar 30 2015 — edited Apr 1 2015

Hi

I have a password proteced winzip file - which I understand to be AES256 encrypted.

I have 'loaded' this file into my 11g database as a BFILE.

I've been trying to decrypt the file using dbms_crypto using this code:

 

CREATE OR REPLACE FUNCTION DCRYPT2(TO_DECRYPT IN BLOB)

RETURN BLOB

IS

DECRYPTED BLOB;

 

v_key PLS_INTEGER := dbms_crypto.ENCRYPT_AES256 + dbms_crypto.CHAIN_CBC + dbms_crypto.PAD_PKCS5;

 

l_key RAW(32) := UTL_I18N.STRING_TO_RAW('T1o_D3ctrr_Feb15', 'AL32UTF8');

 

BEGIN

dbms_lob.createtemporary(DECRYPTED,true);

DBMS_CRYPTO.DECRYPT(DECRYPTED,TO_DECRYPT,v_key,l_key );

RETURN DECRYPTED;

END;

I then use this function to update my table which contains the BLOB:

 

UPDATE TESTCRYPT SET D = DCRYPT2(E) 

WHERE ID=1;

This results in:

line 62: ORA-28234: key length too short

Any ideas or help would be very gratefully received!

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2015
Added on Mar 30 2015
15 comments
3,287 views