This is a discussion on RE : Generation of DES key - Openssl ; --0-552146410-1206544584=:68767 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello Driss, I think, it will be theDESCheckResult = DES_set_key_checked(&theDESKey1, &theSchedule); DES_ecb_encrypt((DES_cblock *) &buff, (DES_cblock *) &theOutput, &theSchedule, DES_ENCRYPT); Namely that DES_ecb_encrypt is described like that : void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, DES_key_schedule *ks, ...
--0-552146410-1206544584=:68767
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hello Driss,
I think, it will be
theDESCheckResult = DES_set_key_checked(&theDESKey1, &theSchedule);
DES_ecb_encrypt((DES_cblock *) &buff, (DES_cblock *) &theOutput, &theSchedule, DES_ENCRYPT);
Namely that DES_ecb_encrypt is described like that :
void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
DES_key_schedule *ks, int enc)
See opennssl/crypto/des/ecb_enc.c
Abderrahmane,
EL HACHIMI Drissa écrit :
Hello,
I need to encrypt a password with a DES key, I'm trying the following code:
char * buff[20];
int theDESCheckResult;
DES_cblock * theDESKey1;
DES_key_schedule *theSchedule;
DES_cblock * theOutput;
ALMLog (@"Enter your DBPassword");
fgets((char *)&buff, 10, stdin);
theDESKey1 = [[[NSProcessInfo processInfo] globallyUniqueString] UTF8String];
RAND_seed(theDESKey1, strlen(theDESKey1));
theDESCheckResult = DES_set_key_checked(theDESKey1, theSchedule);
DES_ecb_encrypt(buff, theOutput, theSchedule, DES_ENCRYPT);
The DES key is correctly generated but the DES_set_key_checked () function returns -1 which means that the parity is wrong and the function DES_ecb_encrypt () cannot be executed.
Bests Regards
Driss
---------------------------------
Envoyé avec Yahoo! Mail.
Capacité de stockage illimitée pour vos emails.
---------------------------------
Envoyé avec Yahoo! Mail.
Capacité de stockage illimitée pour vos emails.
--0-552146410-1206544584=:68767
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hello Driss,I think, it will betheDESCheckResult = DES_set_key_checked(&theDESKey1, &theSchedule);
DES_ecb_encrypt((DES_cblock *) &buff, (DES_cblock *) &theOutput, &theSchedule, DES_ENCRYPT);fficeffice" />
>> Namely that DES_ecb_encrypt is described like that :void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,
DES_key_schedule *ks, int enc)See
opennssl/crypto/des/ecb_enc.cAbderrahmane,
EL HACHIMI Driss <elhachimi_driss@yahoo.fr> a écrit :Hello,
I need to encrypt a password with a DES key, I'm trying the following code:
char * buff[20];
int theDESCheckResult;
DES_cblock * theDESKey1;
DES_key_schedule *theSchedule;
DES_cblock * theOutput;
ALMLog (@"Enter your DBPassword");
fgets((char *)&buff, 10, stdin);
theDESKey1 = [[[NSProcessInfo processInfo] globallyUniqueString] UTF8String];
RAND_seed(theDESKey1,
strlen(theDESKey1));
theDESCheckResult = DES_set_key_checked(theDESKey1, theSchedule);
DES_ecb_encrypt(buff, theOutput, theSchedule, DES_ENCRYPT);>>
The DES key is correctly generated but the DES_set_key_checked () function returns -1 which means that the parity is wrong and the function DES_ecb_encrypt () cannot be executed.
Bests Regards
Driss
Envoyé avec Yahoo! Mail.
Capacité de stockage illimitée pour vos emails.
Envoyé avec Yahoo! Mail.
Capacité de stockage illimitée pour vos emails.
--0-552146410-1206544584=:68767--
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majordomo@openssl.org