Re: Crypto API using RC2 instead of RC4?
From: Valery Pryamikov (valery_at_harper.no)
Date: 11/24/05
- Next message: Sami J. Lehtinen: "Re: User account management and information functions usage with trusted domains"
- Previous message: Mick J.: "Re: access control on key containers"
- In reply to: Matt: "Re: Crypto API using RC2 instead of RC4?"
- Next in thread: Matt: "Re: Crypto API using RC2 instead of RC4?"
- Reply: Matt: "Re: Crypto API using RC2 instead of RC4?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 24 Nov 2005 10:01:17 +0100
"prepare data for decryption" step is only pre-allocating buffers. btw.
decryption doesn't expand, so you don't need to increase buffer size for
decryption, and even for encryption - doubling of buffer size is quite
redundant - you only need to add whole block size and round it up to the
nearest number divisable by 8 (as usually -- code in KB article is only for
demostration purposes and not for use in production).
padding is added by cryptencrypt and removed by cryptdecrypt. Since you
didn't specify padding -- you use default PKCS7 padding.
What could be a problem is your use of strings as storage of encrypted data.
Encrypted data is binary array. No, don't send me your code -- I don't
program vb, I don't have vb6 installed anywhere around and I even don't have
any time to look at your code, sorry.
-Valery.
http://www.harper.no/valery
"Matt" <mtaylor@gladstonemrm.com> wrote in message
news:1132788420.573740.144320@g49g2000cwa.googlegroups.com...
> Hello Valery,
>
> My test application creates a random string.
> It then passses that string to be encrypted.
> The returned encrypted string is then immediately decrypted to make
> sure it matches the original string.
> This works about 19 out of 20 times until the CryptDecrypt API call
> returns False resulting in an error being raised.
>
> I'm not clued up on encryption but as far as I can tell all the padding
> is done in the
> '-- Prepare data for decryption.--' section in the function I posted,
> and that is identical to the Encrypt function so should work fine?
> The KB example code certainly does not provide the ability to set any
> padding, only the ciphers and a password key.
>
> If you are willing I am happy to send you a ready to run test project
> so that you can see for yourself.
>
> Thanks,
>
> Matt
>
- Next message: Sami J. Lehtinen: "Re: User account management and information functions usage with trusted domains"
- Previous message: Mick J.: "Re: access control on key containers"
- In reply to: Matt: "Re: Crypto API using RC2 instead of RC4?"
- Next in thread: Matt: "Re: Crypto API using RC2 instead of RC4?"
- Reply: Matt: "Re: Crypto API using RC2 instead of RC4?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|