in reply to Re: xor encrypt-decrypt routine
in thread xor encrypt-decrypt routine
That encrypts/decrypts perfectly, but seems to end abruptly after running through 1k of data. Now I'm even more confused. What's the difference between this code and the code I posted before?while(my $char = getc(IN)) { if($kp >= length($key)) { $kp = 0; } my $kc = substr($key, $kp++, 0); $char ^= $kc; print OUT $char; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: xor encrypt-decrypt routine
by tye (Sage) on Jan 21, 2001 at 10:06 UTC |