in reply to Re: Re: Re: A real challenge
in thread A real challenge
#!/usr/bin/perl open(FILE, "Z:\\test\\ftp\\dlclient\\NEFTPClient-1.6.exe"); # Read every line in the file my $filestring; binmode(FILE); binmode(STDOUT); while (<FILE>) { $filestring .= $_; } close FILE; my @encoded = split //, $filestring; # Our decode string #my @decode = (67,111,112,121,114,105,103,104,116,32,169,32,50,48,48,5 +0,32,65,99,116,105,118,101,83,116,97,116,101,32,84,111,111,108,32,67, +111,114,112,46); #my $key = 'Copyright © 2000 ActiveState Tool Corp.'; my $key = 'Copyright © ActiveState Corp 2001-2002.'; #my $key = 'Copyright © 2002 ActiveState Tool Corp.'; #my $key = 'Copyright (C) 2002 NewsEdge Corp'; #my $key = ' '; my @keystring = split //, $key; foreach my $num (@keystring) { push @decode, ord($num); } print "@decode\n\n@encodedstring\n"; # Our unecoded string my @unencoded; for my $char (@encoded){ # XOR the encoded string with the decode character push @unencoded, ($char ^ $decode[0]); # Rotate the decode string push @decode, shift @decode; } for my $char (@unencoded){ if ($char == 10){ # Print a newline if the charater is 10 print "\n"; } else { # Print out the unencoded string #print chr($char); print chr($char); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: RE: A real challenge
by tachyon (Chancellor) on Nov 27, 2002 at 01:30 UTC | |
by Anonymous Monk on Jan 30, 2003 at 21:31 UTC |