Re: RC4 implementation question

From: Gregory G Rose (ggr_at_qualcomm.com)
Date: 04/05/04


Date: 5 Apr 2004 04:28:49 -0700

In article <c4rb5u$2gqfdv$1@ID-161723.news.uni-berlin.de>,
lallous <lallous@lgwm.org> wrote:
>Everytime I encrypt, 'k1' is getting modified. In order to decrypt, I have
>to have the key in the original initiated form and call rc4_crypt() in the
>same order as the buffers were called to encrypt.
>
>1)Is this a good RC4 implementation?

The array and variables associated with RC4 are
usually referred to as "state", rather than "key".
The key is the "abcd" you used to initialise it
with in the first place.

So, in the sense that this implementation calls it
"key", I would not call it a good implementation.

>2)Does the usual RC4 implementation change the 'key' ?

Yes, it changes the state as it encrypts. The
implementation is probably faithful (I didn't
check).

RC4 is a "synchronous stream cipher", which means
that the encryption and decryption ends must
remain correctly synchronised. That's what you're
seeing.

Greg.

-- 
Greg Rose
232B EC8F 44C6 C853 D68F  E107 E6BF CD2F 1081 A37C
Qualcomm Australia: http://www.qualcomm.com.au


Relevant Pages

  • RE: NTE_BAD_DATA
    ... They are NOT used DIRECTLY to encrypt / decrypt data; ... you should generate a RANDOM SESSION KEY and select a SYMMETRIC ENCRYPTION ... // imported from a BLOB read in from the source file or having ...
    (microsoft.public.platformsdk.security)
  • Re: Back Doors
    ... >> Design into the system a master key. ... Encrypt that with public key. ... Decrypt random symmetric key with private key. ...
    (sci.crypt)
  • Re: CAPI and RC4: can not decrypt when Final parameter is set to F
    ... to store ASYMMETRIC key pairs - never symmetric keys like RC4, ... Now when you need to encrypt at one place and decrypt at the other normally ... Get a HCRYPTPROV handle to a key container with CryptAcquireContext ...
    (microsoft.public.platformsdk.security)
  • Re: RSA - Public vs. Private Keys
    ... This is a common pattern for license software ... your client will send a unique machine hash to the ... will let us decrypt with a Public Key (or simply not ... |> RSA is intended to encrypt messages with public keys only. ...
    (microsoft.public.dotnet.security)
  • Re: .NET Crypto Classes Interoperability with Win32 Crypto APIs
    ... when i encrypt a string using .NET classes and try to ... > decrypt it using Win32 APIs, ... > UnicodeEncoding(); ...
    (microsoft.public.dotnet.security)

Loading