Below is the code, you need to restore the values '47533', '23182', '52170' from the obtained value.

Tell me how you can solve? Or you can remake the algorithm, the main task of the 3 numbers of the variable $a get one, from which you can restore the initial 3 numbers. Only the result of the $result variable is known.

 $table = array(0x003b6c1c, 0x002def61, 0x006effa2, 0x0013045f, 0x00873358, 0x0039e1fd, 0x0061491a, 0x002608bf, 0x00254ed0, 0x004fc7dd, 0x00721a32, 0x0018dce3, 0x001328bc, 0x003e288d, 0x0084387e, 0x004c11e3); $a = array('47533', '23182', '52170'); $result = ""; for($i = 0;$i < count($a);$i++) { $result += $a[$i]^$table[$i]; } echo $result; //Результат: 14139400 
  • What is the scope of the original "numbers"? unsigned word ? - vp_arth
  • 3
    From what is, you can not restore the original numbers. - vp_arth
  • 2
    Given the amount of 13, restore the original terms of the number of three. - Vladimir Martyanov
  • It is not necessary to rest on this algorithm, you need a solution to the problem itself, but the algorithm itself can be redone. The main thing is to get 1 value and not more than 20 billion. - user235655
  • I asked, what are the sizes / boundaries of the original numbers? - vp_arth

1 answer 1

The number of bits of information encrypted message can not be less than the total number of bits of the original data.

Reduce the number of 8-12 characters by 2 digits, with the possibility of restoring to its original state

I will demonstrate the absurdity of the problem statement:

Suppose there is such an algorithm:

 function shortBy2($number) { //return shortened; } function r($a) {/*implementation*/} $input = 123456123456; $r1 = shortBy2($input); // length is 10 $r2 = shortBy2($r1); // length is 8 $r3 = shortBy2($r2); // length is 6 $r4 = shortBy2($r3); // length is 4 $r5 = shortBy2($r4); // length is 2 

Thus, any number can be reduced to one of one hundred numbers. But by assumption we can restore the original number:

 $r1 == r(r(r(r($r5)))); 

however, it is obvious that with one hundred possible values ​​of the argument, we will get no more than 100 different results of the “recovery”.


There is, of course, Grandma's archiver, but these are secret technologies.