3v4l.org

run code in 300+ PHP versions simultaneously
<?php $defaultdata = json_encode(array( "showpassword"=>"yes", "bgcolor"=>"#ffffff")); function xor_decrypt($in) { if ($in != ''){ $text = $in; $key = json_encode(array( "showpassword"=>"no", "bgcolor"=>"#ffffff"));} else{ $text = json_encode(array( "showpassword"=>"yes", "bgcolor"=>"#ffffff")); $key = "qw8J";} // Iterate through each character $outText = ''; for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } print "Key is currently unknown.\n OriginalData ^ Key = CipherText\n\t"; print " so that also means,\n OriginalData ^ Ciphertext = Key\n Therefore the key will repeat itself: "; print xor_decrypt(base64_decode("HmYkBwozJw4WNyAAFyB1VUcqOE1JZjUIBis7ABdmbU1GIjEJAyIxTRg=")); print "\nNow that we know the key lets create a new cookie to display the password: \n"; print base64_encode(xor_decrypt("")); print "\n"; ?>
Output for 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
Key is currently unknown. OriginalData ^ Key = CipherText so that also means, OriginalData ^ Ciphertext = Key Therefore the key will repeat itself: eDWoeDWoeDWoeDWoeDWoeDWoeDWoeDWoeDWoeDWoe Now that we know the key lets create a new cookie to display the password: ClVLIh4ASCsCBE8lAxMacFMOXTlTWxooFhRXJh4FGnBTVF4sFxFeLFMK

preferences:
42.75 ms | 407 KiB | 5 Q