Re: Problems with RC5 (looks simple enough)

[email protected] (John Francis) Fri, 12 Jul 2002 15:21:36 -0400 (EDT)
Newsgroups perl.crypto
Message-ID <[email protected]>
Benjamin, 
       Thanks for the update, will definately try it out. However, the RC5
problem doesnt just end with newlines, I think other non-alphanumeric
characters cause problems as well. Also, I think this problems exists in
implementations in other languages such as C. I was trying to do the same
project in C but was getting similar problems, I ported over to Perl so
that I would not have to deal with byte-by-byte problems. Thanks for all
the help to all who provided the advise.
					- John


On Fri, 12 Jul 2002, Benjamin Trott wrote:

> > Yeah, I tried it on linux, and same problem. I don't think it handles
> > newlines right.
> 
> This patch fixes the newline bug:
> 
> --- RC5.pm.orig      Mon Nov 26 08:05:50 2001
> +++ RC5.pm   Fri Jul 12 11:18:31 2002
> @@ -65,7 +65,7 @@
>           $A = Y( @S, 3 );
>           $B = Y( @L, M( $A + $B ) );
>       }
> -    while ( $text =~ /(.{8})/g ) {
> +    while ( $text =~ /(.{8})/gs ) {
>           $last = $';
>           Process( $1, $decrypt );
>       }
> 
> bye,
> Ben
> 
>