Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Xor decode from pcap file

by AnomalousMonk (Chancellor)
on Jun 18, 2011 at 18:34 UTC ( #910348=note: print w/replies, xml ) Need Help??


in reply to Xor decode from pcap file

Maybe something like this:

>perl -wMstrict -le "my $binary = pack 'H*', '03762cefa7ffe5'; printf '%02x ', $_ for unpack 'C*', $binary; print ''; ;; my ($p, $q) = unpack 'xCC', $binary; my $pairs = (length($binary) - 3) / 2; my $k = pack 'C*', 0, 0, 0, ($p, $q) x $pairs; printf '%02x ', $_ for unpack 'C*', $k; print ''; ;; my $decode = $binary ^ $k; printf '%02x ', $_ for unpack 'C*', $decode; " 03 76 2c ef a7 ff e5 00 00 00 76 2c 76 2c 03 76 2c 99 8b 89 c9

Replies are listed 'Best First'.
Re^2: Xor decode from pcap file
by mabossert (Scribe) on Jun 18, 2011 at 18:55 UTC
    Sweet! That seems to have done the trick...Thank you so much. I have a huge headache from banging my head on the wall trying to figure out how to accomplish this. Now all I have to do is figure out what the heck the decoded data means...Thanks again!!!!
      Would you mind posting the completed code?
        my apologies...I didn't notice the request to post the completed code. Unfortunately, I moved to a new job and no longer have access to the code...sorry.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://910348]
help
Chatterbox?
[erix]: going for a run in the dunes - unless the storm (well, Beaufort 7) gets fiercer
Discipulus had stew with tomato sauce, onions, carrots and potatoes + bottle of red wine and still warm bred.. slept as dynosaur

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (15)
As of 2017-11-22 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (316 votes). Check out past polls.

    Notices?