[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] InternetConfig



At 21.52 -0700 2000.04.14, Brian McNett wrote:
>>From ICProgKit2.0.2:Prog_Docs.html
>
>  for i in 1 .. length(str)
>    str[i] := str[i] xor ($55 + i);
>  end-for;
>
>I can get the scrambled password like so:
>
>#!perl -w
>
>use Mac::InternetConfig;
>
>my $i = 0;
>my $scrambled = $InternetConfig{kICMailPassword()};
>
>All I really need at this point is the scrambling algorithm re-written in
>Perl.
>I'm almost there, but I'd like to see how a few others would do this.


#!perl -w
use Mac::InternetConfig;

die "No Password" unless my $badpass = $InternetConfig{kICMailPassword()};
my $i = 0;

for (split //, $badpass) {
    $goodpass .= chr(ord($_) ^ (++$i + 0x55));
}

print $goodpass;
__END__

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org