<?
$key= json_encode(array("showpassword"=>"no", "bgcolor"=>"#ffffff"));
$data=base64_decode('ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSEV4sFxFeaAw');
function xor_encrypt($text, $key) {
$key= json_encode(array("showpassword"=>"no", "bgcolor"=>"#ffffff"));
$outText = '';
// Iterate through each character
for($i=0;$i<strlen($text);$i++) {
$outText .= $text[$i] ^ $key[$i % strlen($key)];
}
return $outText;
}
$key=xor_encrypt($data,$key);
echo xor_encrypt(array("showpassword"=>"yes", "bgcolor"=>"#ffffff"),substr($key,0,4));
?>
Output for 8.0.13
Fatal error: Uncaught TypeError: strlen(): Argument #1 ($str) must be of type string, array given in /in/3Wrga:9
Stack trace:
#0 /in/3Wrga(16): xor_encrypt(Array, '{"showpassword"...')
#1 {main}
thrown in /in/3Wrga on line 9
Process exited with code 255.