Re: What's wrong with this RC4?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


sci.crypt archive

Re: What's wrong with this RC4?

From: Andrew Pogrebennyk <andrew86@voliacable.com>
Date: Thu Dec 29 2005 - 13:33:41 CET

On Wed, 28 Dec 2005 10:14:32 -0700, Chris Barts wrote:

> Andrew Pogrebennyk <andrew86@voliacable.com> wrote on Wednesday 28 December
> 2005 04:56 in sci.crypt <pan.2005.12.28.11.56.35.888981@voliacable.com>:
>
>> int main()
>
> int main(void)
>
>>
>> cipher = calloc (SIZEOF(plain), sizeof(plain[0]));
>
> What if calloc() fails? Always wrap these calls in if statements like so:
>
> if ((cipher = calloc(sizeof(plain), sizeof(plain[0])) == NULL) {
> fprintf(stderr, "rc4: calloc() failed\n");
> exit(EXIT_FAILURE);
> }
>
> Of course, you might have a more intelligent failure mode in mind than that.
> For this program, however, that is plenty good enough.
>
>>
>> free (cipher);
>
> You'd be surprised how often people fail to do this.
>
>> return 0;
>
> And this.

Thanks, I fixed that. Even more, I have now a well working CipherSaber
implementation :)

And I'm still very interested in learning such techniques as multi round
initiation of RC4 or 2-byte RC4.
Received on Tue Jan 3 03:41:45 2006