If the codeproject returns 59 chars - then there is something wrong
Your test string is 26 chars and the result should be of the same length. Length of Hex(result) should be 52
I have uploaded an RC4 class - should be visible in the next hours or so
It does
- byte array encryption
- string encryption (string is first converted to a UTF8 byte array)
- stream encryption
>Hi,
>I tried to use RC4 algorithm provided at
http://www.codeproject.com/KB/recipes/rc4csharp.aspx, but the result generated is difference with VfpEncryption
>
>.NET = "203A7BB0530C0347082039D9583A4CF7153695A35EA6C16D92013F5A45E" (59 chars)
>VFP = "9B7BB0530C0347088BD9583A4CF79C695A35EA6C16D996F5A45E" (52 chars)
>
>
>// .NET
>
> CryptoRC4.RC4Engine rc4 = new CryptoRC4.RC4Engine();
>
> rc4.EncryptionKey = "1234567890";
> rc4.InClearText = "QWERTYUIOPASDFGHJKLZXCVBNM";
> bool ok = rc4.Encrypt();
>
> string result = ConvertToHex(rc4.CryptedText);
>
>
>
>** VFP
>strconv(Encrypt("QWERTYUIOPASDFGHJKLZXCVBNM", "1234567890", 1024), 15)
>
>
>Any ides?
>
>Thank you
Gregory