Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: DES3Encrypt
Ruslan R. Laishev wrote:
> Hi !
> I playing with the follows piece of code is supposed to
> encrypt/decrypt data encrypted/decrypted with the ORACLE
> DES3Encrypt/Decrypt function:
>
> {
> unsigned status,i, len = ibuflen;
> des_key_schedule ks1,ks2,ks3;
> unsigned char *pblock = ibuf, padding_char,
> ivec1 [] = "0123456789ABCDEF",
> ivec2 [] = "0123456789ABCDEF",
> ivec3 [] = "0123456789ABCDEF";
>
>
> *retlen = 0;
>
> /*
> ** Check all keys for weakness
> */
> if ( status = des_key_sched((C_Block *)key1,ks1) )
> wr2_3des__log(status,"des_key_sched(k1)");
> if ( status = des_key_sched((C_Block *)key2,ks2) )
> wr2_3des__log(status,"des_key_sched(k2)");
> if ( status = des_key_sched((C_Block *)key3,ks3) )
> wr2_3des__log(status,"des_key_sched(k3)");
>
>
> if ( doEncrypt == DES_ENCRYPT )
> {
> des_cbc_encrypt(ibuf,obuf,ibuflen,ks1,ivec1,DES_ENCRYPT);
> des_cbc_encrypt(obuf,obuf,ibuflen,ks2,ivec2,DES_DECRYPT);
> des_cbc_encrypt(obuf,obuf,ibuflen,ks1,ivec1,DES_ENCRYPT);
> }
> else {
> des_cbc_encrypt(ibuf,obuf,ibuflen,ks1,ivec1,DES_DECRYPT);
> des_cbc_encrypt(obuf,obuf,ibuflen,ks2,ivec2,DES_ENCRYPT);
> des_cbc_encrypt(obuf,obuf,ibuflen,ks1,ivec1,DES_DECRYPT);
> }
>
> *retlen = ibuflen;
> return 0;
> }
>
>
>
> Frank van Bortel wrote:
>
>> Ruslan R. Laishev wrote: >> >>> Hello All! >>> I looking for a way to decrypt data encrypted with the >>> DBMS_OBFUSCATION_TOOLKIT.DES3Encrypt with the OpenSSL/DES routines set. >>> >>> >>> Thanks in advance. >>> >> See asktom.oracle.com
But he has working examples - you just need to search for them.
BTW - the above isn't PL/SQL...
-- Regards, Frank van BortelReceived on Thu Mar 11 2004 - 16:17:18 CST