Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <h2>JavaScript Bitwise AND</h2>
- <p id="demo">My First Paragraph.</p>
- <script>
- function hex2a(hexx) {
- var hex = hexx.toString();//force conversion
- var str = '';
- for (var i = 0; i < hex.length; i += 2)
- str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
- return str;
- }
- function xor_encrypt() {
- $hexkey = hex2a('0A554B221E00482B02044F2503131A70531957685D555A2D121854250355026852115E2C17115E680C');
- $key = 'qw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jqw8Jq'
- $text = '{"showpassword":"yes","bgcolor":"#ffffff"}';
- $outText = '';
- // Iterate through each character
- for($i=0;$i<($text).length;$i++){
- $outText+=((($text[$i]).charCodeAt())^(($key[$i%($key).length]).charCodeAt()));
- $outText+= ',';
- }
- return $outText;
- }
- document.write(xor_encrypt());
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement