in reply to Re: Perl function equivalent to PHP xormask
in thread Perl function equivalent to PHP xormask

If you could please share how you were able to get the constant value '30d1c6615af8cfc9', that would be the tidbit of code I'm looking for.

For what it's worth, I tried that same constant value on other IDs (examples: Z0xcAVdKAwkAHVcKUF5VAA, Z0xcAVRKAwkAHVcKUF9bAA) and they were decoded properly.

I hope that makes sense.

  • Comment on Re^2: Perl function equivalent to PHP xormask

Replies are listed 'Best First'.
Re^3: Perl function equivalent to PHP xormask
by poj (Abbot) on Mar 20, 2016 at 18:13 UTC
    #!/usr/bin/perl use warnings; use strict; use MIME::Base64; my $XORmask = "T|808|586|127800" ^ decode_base64('Z0xcAVtKAwkDHVcKVF5T +CQ'); print $XORmask."\n"; print $XORmask ^ decode_base64('Z0xcAVdKAwkAHVcKUF5VAA')."\n"; print $XORmask ^ decode_base64('Z0xcAVRKAwkAHVcKUF9bAA')."\n";
    poj
Re^3: Perl function equivalent to PHP xormask
by Anonymous Monk on Mar 20, 2016 at 18:13 UTC
    If you could please share how you were able to get the constant value

    choroba already did:

    How did I get the magical value? By XORing the expected output with the $track. That's how XOR works.

    i.e.

    $ perl -MMIME::Base64 -le 'print decode_base64( "Z0xcAVtKAwkDHVcKVF5TCQ")^"T|808|586|127800"' 30d1c6615af8cfc9
      Thanks very much :)