Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: DES3Encrypt

Re: DES3Encrypt

From: Ruslan R. Laishev <Laishev{at}DeltaTelecom{dot}RU>
Date: Fri, 12 Mar 2004 10:04:35 +0300
Message-ID: <D7A4418CC1DCBE8155E3CE8397A301EA@nntp>


Hi Frank,

        thanks for the answer, this piece of code is C, I have tried to reproduce the algoritm implemented in the ORACLE DES3Encrypt/Decrypt to processing encrypted data from external applications.

Frank van Bortel wrote:

> 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
>>
>>
>> " Sorry I have a large backlog right now, please ask a question later
>> To ask a question click on the "Submit a New Question" button or Ask A
>> Question."
>>
> 
> But he has working examples - you just need to search for them.
> 
> BTW - the above isn't PL/SQL...

-- 
Cheers, Ruslan.
+---------------------pure personal opinion------------------------+
  RADIUS Server for OpenVMS project - www.starlet.spb.ru/radiusvms/
  TKD (WTF) in Russia, St.-Petersburg - www.TaeKwonDo-WTF.SPb.RU
Received on Fri Mar 12 2004 - 01:04:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US