Sign in or 

|
sabraha5 |
PL/SQL DES3 Encryption/Decryption
Jul 22 2008, 4:33 PM EDT
We are trying to decrypt data written to tables from a Java program which used javax.crypto.Cipher (Cipher.getInstance("DESede")) to encrypt the data ; the DBMS_OBFUSCATION_TOOLKIT has functions/procedures to perform DES3 functionality ; the Java program uses javax.crypto.SecretKeyFactory to generate the secretkey (keyfactory.generateSecret(new DESedeKeySpec(keyBytes))) which is used to do the actual encryption (cipher.init(mode, secretKey)) ; do I need to call the DES3GetKey with the key which was passed into the generateSecret method and then call the DES3Decrypt with the key returned from the DES3GetKey call?
Do you find this valuable?
Keyword tags:
PL/SQL
PL/SQL Intro
|
|
sabraha5 |
1. RE: PL/SQL DES3 Encryption/Decryption
Jul 22 2008, 4:40 PM EDT
I am trying to use the DES3GetKey function from the DBMS_OBFUSCATION_TOOLKIT package as below and getting the following error...ORA-06550: line 5, column 3: PLS-00307: too many declarations of 'DES3GETKEY' match this call ORA-06550: line 5, column 3: PL/SQL: Statement ignored DECLARE l_key VARCHAR2(60) := 'testkey'; l_raw RAW(60); BEGIN DBMS_OBFUSCATION_TOOLKIT.DES3GetKey( DBMS_OBFUSCATION_TOOLKIT.TwoKeyMode , UTL_RAW.cast_to_raw(l_key) , l_raw); DBMS_OUTPUT.put_line('Key : ' || UTL_RAW.cast_to_varchar2(l_raw)); END; I am getting same error trying to use the DES3Encrypt and DES3Decrypt functions also. Do I have to specify the call to the function differently? Thanks! Do you find this valuable? |