<?phpfunction xor_encrypt() { $defaultdata = array( "showpassword"=>"yes", "bgcolor"=>"#ffffff"); $key = 'qw8J'; $text = json_encode($defaultdata); $outText = ''; for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } echo base64_encode(xor_encrypt()); ?>