• Source
    1. <?php
    2. function xor_encrypt() {
    3. $defaultdata = array( "showpassword"=>"yes", "bgcolor"=>"#ffffff");
    4.  
    5. $key = 'qw8J';
    6. $text = json_encode($defaultdata);
    7. $outText = '';
    8.  
    9. for($i=0;$i<strlen($text);$i++) {
    10. $outText .= $text[$i] ^ $key[$i % strlen($key)];
    11. }
    12.  
    13. return $outText;
    14.  
    15. }
    16.  
    17. echo base64_encode(xor_encrypt());
    18.  
    19. ?>