Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $defaultdata = array( "showpassword"=>"no", "bgcolor"=>"#ffffff");
- $data = array( "showpassword"=>"yes", "bgcolor"=>"#ffffff");
- $cookie = "YOUR_COOKIE_HERE";
- function xor_encrypt($in, $defaultdata) {
- $key = $defaultdata;
- $text = $in;
- $outText = '';
- // Iterate through each character
- for($i=0;$i<strlen($text);$i++) {
- $outText .= $text[$i] ^ $key[$i % strlen($key)];
- }
- // Remove duplicate characters
- $outText = implode('', array_unique(str_split($outText)));
- return $outText;
- }
- function xor_encryptkey($in, $xor_key) {
- $key = $xor_key;
- $text = $in;
- $outText = '';
- for($i=0;$i<strlen($text);$i++) {
- $outText .= $text[$i] ^ $key[$i % strlen($key)];
- }
- return $outText;
- }
- $xor_key = xor_encrypt(base64_decode($cookie), json_encode($defaultdata));
- echo base64_encode(xor_encryptkey(json_encode($data),$xor_key));
- ?>
Add Comment
Please, Sign In to add comment