Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: strings to number and XOR

by almut (Canon)
on Oct 07, 2009 at 00:49 UTC ( #799624=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $msg = "this is a test messagez";
    $key = "\x4f\xcb";   # or  $key = pack "n", 0x4fcb;
    ...
    74 68 69 73 20 69 73 20 61 20 74 65 73 74 20 6d 65 73 73 61 67 65 7a
    4f cb
    3b a3 69 73 20 69 73 20 61 20 74 65 73 74 20 6d 65 73 73 61 67 65 7a
    
  2. or download this
        $key = "\x4f\xcb" x (length($msg)/2);
    or
        $key = pack("n", 0x4fcb) x (length($msg)/2);
    
  3. or download this
    t  h  i  s     i  s     a     t  e  s  t     m  e  s  s  a  g  e  z
    74 68 69 73 20 69 73 20 61 20 74 65 73 74 20 6d 65 73 73 61 67 65 7a  
    + $msg
    4f cb 4f cb 4f cb 4f cb 4f cb 4f cb 4f cb 4f cb 4f cb 4f cb 4f cb     
    + $key
    3b a3 26 b8 6f a2 3c eb 2e eb 3b ae 3c bf 6f a6 2a b8 3c aa 28 ae 7a  
    + XOR result
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://799624]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (16)
As of 2014-11-25 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (158 votes), past polls