Print encoded string

I looked at this question ( Is this some kind of CakePHP hack? ), And when I looked at the code, I saw this line:

$wp_cw_kses_split = '>=^/E]u*PDAF$!V'^']O;N18*L%*"2MN8'; 

When I repeat this, it is echos create_function .

How it works? I mean, is that even a string? It has unescaped ' .

Demo: http://ideone.com/rk2Og

+4
source share
3 answers

It performs a banged XOR operation for two lines of '>=^/E]u*PDAF$!V' and ']O;N18*L%*"2MN8' .

 var_dump('>' ^ ']'); // string(1) "c" var_dump('=' ^ 'O'); // string(1) "r" var_dump('^' ^ ';'); // string(1) "e" // ... etc 

The XOR bitwise operation is performed in ASCII code, so for the first,

 ">" = 62 (ASCII) = 0111110 ^ = XOR ------- "]" = 93 (ASCII) = 1011101 ========================== "c" = 99 (ASCII) = 1100011 
+3
source

This is a bitwise XOR operation for strings, which means that ascii values โ€‹โ€‹are XORed characters. Operation Manual Example 2

You have two different lines: >=^/E]u*PDAF$!V and ]O;N18*L%*"2MN8

+3
source

This expression is an operation of two lines:

  1: '>=^/E]u*PDAF$!V' operator: ^ - bitwise XOR 2: ']O;N18*L%*"2MN8' 

As you can see, ' are not "unshielded," but this is intended. It looks a little mysterious, so the brain does not read it as three things, but one (the visual drawing of the end of the line is simply too attractive).

+2
source

Source: https://habr.com/ru/post/1388190/


All Articles