3v4l.org

run code in 500+ PHP versions simultaneously
<?php function xor_encrypt($in) { $key = '<censored>'; $text = $in; $outText = ''; for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } // Combinandole: se la cifratura è // C = P ⊕ K (testo cifrato = testo in chiaro XOR chiave), allora: // C ⊕ K = P → con la chiave recuperi il chiaro // C ⊕ P = K → con il chiaro recuperi la chiave $cookies ="EGAgHwQ1IxYYMSQYGSZxTUksPFVHYDEQCC0%2FGBlgaVVIJDURDSQ1VRY%3D"; $urlC = urldecode($cookies); $known_plain = '{"showpassword":"no"'; // testo in chiaro.... $guess_key = ''; for ($i = 0; $i < strlen($known_plain); $i++) { $guess_key .= $cipher[$i] ^ $known_plain[$i]; } echo $guess_key; $tempdata = json_decode(xor_encrypt(base64_decode($step1)), true);
Output for 8.2.0 - 8.2.34
Warning: Undefined variable $cipher in /in/aTHmD on line 24 Warning: Trying to access array offset on value of type null in /in/aTHmD on line 24 Fatal error: Uncaught TypeError: Unsupported operand types: null ^ string in /in/aTHmD:24 Stack trace: #0 {main} thrown in /in/aTHmD on line 24
Process exited with code 255.
Output for 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Warning: Undefined variable $cipher in /in/aTHmD on line 24 Warning: Trying to access array offset on null in /in/aTHmD on line 24 Fatal error: Uncaught TypeError: Unsupported operand types: null ^ string in /in/aTHmD:24 Stack trace: #0 {main} thrown in /in/aTHmD on line 24
Process exited with code 255.

preferences:
31.74 ms | 1155 KiB | 9 Q