Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Decrypt oracle data with java
Unfortunately, you can't do what you want. The obfuscation toolkit puts in
prepends a header to the data to prevent double encryption (U.S. government
requirement). So, direct decryption will fail.
The only way to do it would be to have the Java code call the obfuscation toolkit.
Rick
In article <347d629d.0204160724.56822214_at_posting.google.com>,
samuel_zarza_at_geocities.com says...
>
>Hi:
> I need to decrypt oracle crypted data (with
>dbms_obfsucation_toolkit) with java code. I've tried with the
>following code but I had no luck:
>
>// I have the string read from Oracle in myCipheredText variable
>
>SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
>DESKeySpec desKeySpec = new DESKeySpec("_MyKey__".getBytes());
>SecretKey desKey = keyFactory.generateSecret(desKeySpec);
>
>Cipher desCipher = Cipher.getInstance("DES");
>desCipher.init(Cipher.DECRYPT_MODE, desKey);
>
>byte[] textoDescifrado = desCipher.doFinal(myCipheredText.getBytes());
>System.out.println(new String(textoDescifrado));
>
>The result isn't the same between oracle and this code.
>
>Thanks.
>
>Regards, Samuel
Rick Wessman Oracle Corporation The opinions expressed above are mine and do not necessarily reflect those of Oracle Corporation.Received on Mon Apr 22 2002 - 09:46:11 CDT