In message <[EMAIL PROTECTED]> on Thu, 13 Jun 2002 11:43:00 
+0800, "Louis Lam" <[EMAIL PROTECTED]> said:

lsauchun> I'm trying to use the AES algorithm of 0.9.7beta in my own program.
lsauchun> 
lsauchun> For setting the key schedule there are 2 apis:
lsauchun> 
lsauchun> AES_set_encrypt_key()
lsauchun> and
lsauchun> AES_set_decrypt_key()
lsauchun> 
lsauchun> Initially I used both of the fxns and set the same userkey
lsauchun> to 2 different schedules, one for encrypting and the other
lsauchun> for decryption.
lsauchun> 
lsauchun> Under the cfb128 mode which i've tried. This didn't work out
lsauchun> -- i could not decrypt the data with the decrypt-schedule.
lsauchun> 
lsauchun> If i've used only one of the set key fxns, for example just
lsauchun> stick to AES_set_encrypt_key() with the same userkey, then
lsauchun> it can decrypt the data.

That's because you don't understand CFB mode.  If you look at the
specifications for it, you'll see that CFB mode does encryption of the
feedback block, regardless of if the message is being encrypted or
decrypted.  The same goes for OFB mode, BTW.

I made exactly the same mistake when I coded the EVP interface for
AES, btw...

lsauchun> What is the purpose of AES_set_decrypt_key() then in this
lsauchun> case..how is it being used? Under what situation?

ECB and CBC modes.

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-168 35  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to