in reply to Perl function equivalent to PHP xormask

You can define it as
sub XORmask { '30d1c6615af8cfc9' }

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

#!/usr/bin/perl use warnings; use strict; use MIME::Base64; use constant XORmask => '30d1c6615af8cfc9'; my $id = 'Z0xcAVtKAwkDHVcKVF5TCQ'; my $track_decode = decode_base64($id); print $track_decode ^ XORmask, "\n";

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Perl function equivalent to PHP xormask
by wubbaducki (Initiate) on Mar 20, 2016 at 17:53 UTC

    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.

      #!/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
      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 :)