[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-cryptoapi
Subject:    Re: CryptDecrypt() -- strange behavior?
From:       Samir Bajaj <samirbajaj () HOTMAIL ! COM>
Date:       2002-08-15 0:16:10
[Download RAW message or body]


Sorry about this, folks...looks like a bug in my (self-authored) CSP.

Thank you for taking the time to read and/or respond to my query. I
apologize for taking up the bandwidth needlessly. I'll come back with
a genuine problem next time :-)

--Samir


===============
Date:         Wed, 14 Aug 2002 08:22:21 -0700
From:         Laszlo Elteto <lelteto@RAINBOW.COM>
Subject:      Re: CryptDecrypt() -- strange behavior?

I've just checked with MS CSP as well as the Rainbow Swift CSP and didn't
find any problem: any encrypted block correctly decrypted no matter what
order I asked.
1. Do you use "Final" in Decrypt as well? (If not, obviously you will run
into problem)
2. What CSP do you use? It could be an implementation bug there...

Laszlo Elteto
Fellow Scientist
Rainbow Technologies, Inc.

-----Original Message-----
From: Samir Bajaj [mailto:samirbajaj@HOTMAIL.COM]
Sent: Tuesday, August 13, 2002 6:03 PM
To: CryptoAPI@DISCUSS.MICROSOFT.COM
Subject: CryptDecrypt() -- strange behavior?


Hi all,

   I am running into a weird anomaly when using the
CryptDecrypt()/CryptDecrypt() APIs.

   I encrypt some blocks of binary data using the
CryptEncrypt() API, RC4, 128-bit key, and each block
is encrypted with the "final" parameter set to TRUE
(these are independent blocks of data).

   If I follow the call to CryptEncrypt() immediately
with a call to CryptDecrypt(), the decryption succeeds
and I get the same data back.

   However, if I attempt to decrypt the encrypted
buffers at some later point (and not necessarily in
the same order in which they were encrypted), the
CryptDecrypt() API succeeds, but the result is garbage!

   Am I missing something here? I checked and rechecked
the algorithm and key length, etc., in both API calls
and they are identical. I set the "final" argument to
true in both APIs, so that the blocks can be treated
independently.

   Any pointers as to what I could be missing will
be deeply appreciated.

Thanks.
--Samir


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic