Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title>GrrConCrypto Decode</title>
- <br>
- Maybe you can help me decode this:<br>
- <strong>
- 唶啮噂偹囷啲分孥垒側囲倫匓圷匳匸厓儳匳圠劅卍唲夠噦彲切周噒偮噗塴切却噗倮
- </strong>
- <!-- It is possible to do this without any programming whatsoever -->
- <br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br><br>
- <br>
- <br>
- <br>
- Below is the encode function... I seem to have forgoten the decode function... oops.
- <br>
- <br>
- <br>
- <input type="text" id="toEncode"/>
- <input type="button" onclick="doEncode()" value="encode"/><br/><br/>
- <div id="outputContainer" style="display:none;">
- <span style="display: inline-block; width: 120px;">Encoded:</span><span id="outputEnc"></span><br/>
- </div>
- </body>
- </body>
- <script type="text/javascript">
- GrrConCrypto = function() {
- }
- GrrConCrypto.BASE_FLAG_START = 0x04000;
- GrrConCrypto.BASE1_START = 0x05000;
- GrrConCrypto.BASE_FLAG_SIZE = 0x100;
- GrrConCrypto.BASE1_SIZE = 0x01000;
- GrrConCrypto.encode = function(raw)
- {
- var offset = 0;
- var result = "";
- for(var i=0;i<raw.length*2-2;i+=3) {
- if(i%2==0)
- offset = ((raw[i/2]<<4)|((raw[i/2+1]>>>4)&0x0f))&0x0fff;
- else
- offset = ((raw[(i-1)/2]<<8)|(raw[(i+1)/2]&0xff))&0x0fff;
- offset += GrrConCrypto.BASE1_START;
- result += String.fromCharCode(offset);
- }
- if((raw.length*2) % 3 == 2) {
- offset = (raw[raw.length-1]&0xff)+GrrConCrypto.BASE_FLAG_START;
- result += String.fromCharCode(offset);
- } else if((raw.length*2) % 3 == 1) {
- offset = ((raw[raw.length-1]&0x0f))+GrrConCrypto.BASE_FLAG_START;
- result += String.fromCharCode(offset);
- }
- return result;
- }</script>
- </head>
- <body>
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
- <script type="text/javascript">
- toString = function(array)
- {
- var result = "";
- for(var i=0;i<array.length;i++)
- result+=String.fromCharCode(array[i]);
- return result;
- };
- toArray = function(string)
- {
- var result = new Uint8Array(string.length);
- for(var i=0;i<string.length;i++)
- result[i] = string.charCodeAt(i);
- return result;
- };
- doEncode = function()
- {
- var encoded = GrrConCrypto.encode(toArray($('#toEncode').val()));
- $('#outputEnc').text(encoded);
- $('#outputContainer').show();
- };
- </script>
Add Comment
Please, Sign In to add comment