alager has asked for the wisdom of the Perl Monks concerning the following question:
Thanks, Aaron#!/usr/bin/perl 2 3 $msg = "this is a test messagez"; 4 $key = 0x4fcb; 5 print "$msg\n"; 6 7 @array = split(/(..)/, $msg); 8 9 10 printf "key: %x\n", $key; 11 12 $xitem = unpack("H*", $array[1]) ^ $key; 13 print "item: $array[1] = hex " . unpack("H*", $array[1]) . "\n"; 14 printf ("xored item \'%x\', want 0x3ba3\n", $xitem);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strings to number and XOR
by almut (Canon) on Oct 07, 2009 at 00:49 UTC | |
by Anonymous Monk on Oct 07, 2009 at 05:13 UTC | |
by alager (Acolyte) on Oct 07, 2009 at 17:52 UTC | |
by almut (Canon) on Oct 07, 2009 at 18:23 UTC | |
by Anonymous Monk on Oct 07, 2009 at 16:57 UTC | |
by Anonymous Monk on Oct 07, 2009 at 17:01 UTC | |
by almut (Canon) on Oct 07, 2009 at 17:20 UTC | |
|
Re: strings to number and XOR
by JavaFan (Canon) on Oct 07, 2009 at 00:40 UTC |