Advertisement
badwolves1986

base64 php whit bd86

Nov 2nd, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 25.41 KB | None | 0 0
  1. <html>
  2. <center>
  3. <head>
  4. badwolves1986
  5. </head>
  6. </center><center>
  7. <title>badwolves1986 encode/decode</title></center>
  8. <body style="margin-top:10px;"  dir="ltr" text="#008000" vlink="#00c000" alink="#000000" background="http://images2.layoutsparks.com/1/242173/hacker-mayhem-matrix-image-31000.gif" bgcolor="#000000" link="#00c000">
  9.  
  10. <style type="text/css">.cAdBafdWzMP {z-index:9000;position:absolute;top:0;left:0;width:100%} div > div.cAdBafdWzMP {position:fixed;}#adTextafdWzMP {position:absolute;top:0;left:0;width:100%;line-height:22px;background:#fff;border-bottom: 1px outset;}}</style><!--[if gte IE 5.5]><![if lt IE 9]><style type="text/css">div#aBarVafdWzMP {width:expression(((ignoreMe=(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth))<200?200:ignoreMe)+'px');position:absolute;top:expression((ignoreMe2=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+'px');left:expression((ignoreMe=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)+'px');}</style><![endif]><![endif]-->
  11. <div id="adBarafdWzMP">
  12.     <div class="cAdBafdWzMP" id="aBarVafdWzMP">
  13.         <div id="uzcrsite" style="position:absolute;z-index:9001;right:25px; top:1px">
  14.         </div>
  15.         <div style="position:absolute;z-index:9001;right:5px; top:3px;">
  16.         <a href="javascript://" onmouseover="document.getElementById('clobutafdWzMP').src='http://s102.ucoz.net/img/bn/clo1.gif'" onmouseout="document.getElementById('clobutafdWzMP').src='http://s102.ucoz.net/img/bn/cl1.gif'" onclick="document.getElementById('adBarafdWzMP').style.display='none';return false;"><img id="clobutafdWzMP" title="Close" align="absmiddle" border="0" src="http://s102.ucoz.net/img/bn/cl1.gif" width="14" height="14"></a>
  17.         </div>
  18.         <div id="adTextafdWzMP" style="height:22px;">
  19.  
  20.             <div style="height:22px;padding-top:3px;">
  21.             <iframe src="../../../profil.php?id=" frameborder="0" scrolling="no" width="100%" height="25" allowtransparency="allowtransparency"></iframe>
  22.             </div>
  23.         </div>
  24.     </div>
  25. </div>
  26. <script type="text/javascript">document.getElementById("adBarafdWzMP").style.height=document.getElementById("adTextafdWzMP").offsetHeight+'px';</script> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <script type="text/javascript"> <!-- //Disable right click script //visit http://www.rainbow.arch.scriptmania.com/scripts/ var message="Sorry, right-click has been disabled"; /////////////////////////////////// function clickIE() {if (document.all) {(message);return false;}} function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} document.oncontextmenu=new Function("return false") // --> </script> </head> <body background="http://i968.photobucket.com/albums/ae161/achmadmuhlisin/331788959.gif" bgcolor="#000000"> <center> <embed allowscriptaccess="never" allownetworking="internal" src="http://www54.indowebster.com/5phorclutws2t5eygsnuvq83jy6clw92.swf" autostart="TRUE" loop="TRUE" align="MIDDLE" height="0" width="0"> <br> <img src="http://www.cyber-warrior.org/bug.jpg"> <br> <font color="ffffff" face="Arial"> <br> <SCRIPT language=JavaScript type=text/javascript> <!-- var rows=1; // must be an odd number var speed=10; // lower is faster var reveal=2; // between 0 and 2 only. The higher, the faster the word appears var effectalign="center" //enter "center" to center it. /*********************************************** * The Matrix Text Effect- by Richard Womersley (http://www.mf2fm.co.uk/rv) * This notice must stay intact for use * Visit http://www.dynamicdrive.com/ for full source code ***********************************************/ var w3c=document.getElementById && !window.opera;; var ie45=document.all && !window.opera; var ma_tab, matemp, ma_bod, ma_row, x, y, columns, ma_txt, ma_cho; var m_coch=new Array(); var m_copo=new Array(); function matrix() { if (!w3c && !ie45) return var matrix=(w3c)?document.getElementById("matrix"):document.all["matrix"]; ma_txt=(w3c)?matrix.firstChild.nodeValue:matrix.innerHTML; ma_txt=" "+ma_txt+" "; columns=ma_txt.length; if (w3c) { while (matrix.childNodes.length) matrix.removeChild(matrix.childNodes[0]); ma_tab=document.createElement("table"); ma_tab.setAttribute("border", 0); ma_tab.setAttribute("align", effectalign); ma_tab.style.backgroundColor="#000000"; ma_bod=document.createElement("tbody"); for (x=0; x<rows; x++) { ma_row=document.createElement("tr"); for (y=0; y<columns; y++) { matemp=document.createElement("td"); matemp.setAttribute("id", "Mx"+x+"y"+y); matemp.className="matrix"; matemp.appendChild(document.createTextNode(String.fromCharCode(160))); ma_row.appendChild(matemp); } ma_bod.appendChild(ma_row); } ma_tab.appendChild(ma_bod); matrix.appendChild(ma_tab); } else { ma_tab='<ta'+'ble align="'+effectalign+'" border="0" style="background-color:#000000">'; for (var x=0; x<rows; x++) { ma_tab+='<t'+'r>'; for (var y=0; y<columns; y++) { ma_tab+='<t'+'d class="matrix" id="Mx'+x+'y'+y+'">&nbsp;</'+'td>'; } ma_tab+='</'+'tr>'; } ma_tab+='</'+'table>'; matrix.innerHTML=ma_tab; } ma_cho=ma_txt; for (x=0; x<columns; x++) { ma_cho+=String.fromCharCode(32+Math.floor(Math.random()*94)); m_copo[x]=0; } ma_bod=setInterval("mytricks()", speed); } function mytricks() { x=0; for (y=0; y<columns; y++) { x=x+(m_copo[y]==100); ma_row=m_copo[y]%100; if (ma_row && m_copo[y]<100) { if (ma_row<rows+1) { if (w3c) { matemp=document.getElementById("Mx"+(ma_row-1)+"y"+y); matemp.firstChild.nodeValue=m_coch[y]; } else { matemp=document.all["Mx"+(ma_row-1)+"y"+y]; matemp.innerHTML=m_coch[y]; } matemp.style.color="#FFFFFF"; matemp.style.fontWeight="bold"; } if (ma_row>1 && ma_row<rows+2) { matemp=(w3c)?document.getElementById("Mx"+(ma_row-2)+"y"+y):document.all["Mx"+(ma_row-2)+"y"+y]; matemp.style.fontWeight="normal"; matemp.style.color="#FFFFFF"; } if (ma_row>2) { matemp=(w3c)?document.getElementById("Mx"+(ma_row-3)+"y"+y):document.all["Mx"+(ma_row-3)+"y"+y]; matemp.style.color="#FFFFFF"; } if (ma_row<Math.floor(rows/2)+1) m_copo[y]++; else if (ma_row==Math.floor(rows/2)+1 && m_coch[y]==ma_txt.charAt(y)) zoomer(y); else if (ma_row<rows+2) m_copo[y]++; else if (m_copo[y]<100) m_copo[y]=0; } else if (Math.random()>0.9 && m_copo[y]<100) { m_coch[y]=ma_cho.charAt(Math.floor(Math.random()*ma_cho.length)); m_copo[y]++; } } if (x==columns) clearInterval(ma_bod); } function zoomer(ycol) { var mtmp, mtem, ytmp; if (m_copo[ycol]==Math.floor(rows/2)+1) { for (ytmp=0; ytmp<rows; ytmp++) { if (w3c) { mtmp=document.getElementById("Mx"+ytmp+"y"+ycol); mtmp.firstChild.nodeValue=m_coch[ycol]; } else { mtmp=document.all["Mx"+ytmp+"y"+ycol]; mtmp.innerHTML=m_coch[ycol]; } mtmp.style.color="#FFFFFF"; mtmp.style.fontWeight="bold"; } if (Math.random()<reveal) { mtmp=ma_cho.indexOf(ma_txt.charAt(ycol)); ma_cho=ma_cho.substring(0, mtmp)+ma_cho.substring(mtmp+1, ma_cho.length); } if (Math.random()<reveal-1) ma_cho=ma_cho.substring(0, ma_cho.length-1); m_copo[ycol]+=199; setTimeout("zoomer("+ycol+")", speed); } else if (m_copo[ycol]>200) { if (w3c) { mtmp=document.getElementById("Mx"+(m_copo[ycol]-201)+"y"+ycol); mtem=document.getElementById("Mx"+(200+rows-m_copo[ycol]--)+"y"+ycol); } else { mtmp=document.all["Mx"+(m_copo[ycol]-201)+"y"+ycol]; mtem=document.all["Mx"+(200+rows-m_copo[ycol]--)+"y"+ycol]; } mtmp.style.fontWeight="normal"; mtem.style.fontWeight="normal"; setTimeout("zoomer("+ycol+")", speed); } else if (m_copo[ycol]==200) m_copo[ycol]=100+Math.floor(rows/2); if (m_copo[ycol]>100 && m_copo[ycol]<200) { if (w3c) { mtmp=document.getElementById("Mx"+(m_copo[ycol]-101)+"y"+ycol); mtmp.firstChild.nodeValue=String.fromCharCode(160); mtem=document.getElementById("Mx"+(100+rows-m_copo[ycol]--)+"y"+ycol); mtem.firstChild.nodeValue=String.fromCharCode(160); } else { mtmp=document.all["Mx"+(m_copo[ycol]-101)+"y"+ycol]; mtmp.innerHTML=String.fromCharCode(160); mtem=document.all["Mx"+(100+rows-m_copo[ycol]--)+"y"+ycol]; mtem.innerHTML=String.fromCharCode(160); } setTimeout("zoomer("+ycol+")", speed); } } // --> setTimeout('matrix()', 1); col=0; function fadein() { document.getElementById("fade1").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade2").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade3").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade4").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade5").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade6").style.color="rgb(" + col + ",0,0)"; col+=5; if(col<255) setTimeout('fadein()', 1); if(col==255) setTimeout('fadeout()', 1); } function fadeout() { document.getElementById("fade1").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade2").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade3").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade4").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade5").style.color="rgb(" + col + ",0,0)"; document.getElementById("fade6").style.color="rgb(" + col + ",0,0)"; col-=5; if(col>0) setTimeout('fadeout()', 1); if(col==0) setTimeout('fadein()', 1); } setTimeout('fadein()', 1);
  27. var Base64 = {
  28.     // private property
  29.     _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  30.        
  31.         // echo(base64_decode(“PGRpdiBjbGFzcz0iZm9vdGVyIj4NCiAgPGRpdiBjbGFzcz0iZm9vdGVyX3R4dCI+IA0KICAgIDxwPiBEZXNpZ25lZCBieTogPGEgaHJlzj0iaHR0cDovL3d3dy
  32. 50YWxrcmV2aWV3cy5jb20vdG9wLXNp
  33. dGVzIj5Ub3AgV2Vic2l0ZSBSZXZpZXdzPC9hPiA8L3A+
  34. DQoNCiAgICA8cD4NCiAgICAgIDxhIGhy
  35. g0KDQo=))
  36.  
  37.     // public method for encoding
  38.     encode : function (input) {
  39.         var output = "";
  40.         var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  41.         var i = 0;
  42.  
  43.         input = Base64._utf8_encode(input);
  44.  
  45.         while (i < input.length) {
  46.  
  47.             chr1 = input.charCodeAt(i++);
  48.             chr2 = input.charCodeAt(i++);
  49.             chr3 = input.charCodeAt(i++);
  50.  
  51.             enc1 = chr1 >> 2;
  52.             enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  53.             enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  54.             enc4 = chr3 & 63;
  55.  
  56.             if (isNaN(chr2)) {
  57.                 enc3 = enc4 = 64;
  58.             } else if (isNaN(chr3)) {
  59.                 enc4 = 64;
  60.             }
  61.  
  62.             output = output +
  63.             this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +
  64.             this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
  65.  
  66.         }
  67.  
  68.         return output;
  69.     },
  70.  
  71.     // public method for decoding
  72.     decode : function (input) {
  73.         var output = "";
  74.         var chr1, chr2, chr3;
  75.         var enc1, enc2, enc3, enc4;
  76.         var i = 0;
  77.  
  78.         input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  79.  
  80.         while (i < input.length) {
  81.  
  82.             enc1 = this._keyStr.indexOf(input.charAt(i++));
  83.             enc2 = this._keyStr.indexOf(input.charAt(i++));
  84.             enc3 = this._keyStr.indexOf(input.charAt(i++));
  85.             enc4 = this._keyStr.indexOf(input.charAt(i++));
  86.  
  87.             chr1 = (enc1 << 2) | (enc2 >> 4);
  88.             chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
  89.             chr3 = ((enc3 & 3) << 6) | enc4;
  90.  
  91.             output = output + String.fromCharCode(chr1);
  92.  
  93.             if (enc3 != 64) {
  94.                 output = output + String.fromCharCode(chr2);
  95.             }
  96.             if (enc4 != 64) {
  97.                 output = output + String.fromCharCode(chr3);
  98.             }
  99.  
  100.         }
  101.  
  102.         output = Base64._utf8_decode(output);
  103.  
  104.         return output;
  105.  
  106.     },
  107.  
  108.     // private method for UTF-8 encoding
  109.     _utf8_encode : function (string) {
  110.         string = string.replace(/\r\n/g,"\n");
  111.         var utftext = "";
  112.  
  113.         for (var n = 0; n < string.length; n++) {
  114.  
  115.             var c = string.charCodeAt(n);
  116.  
  117.             if (c < 128) {
  118.                 utftext += String.fromCharCode(c);
  119.             }
  120.             else if((c > 127) && (c < 2048)) {
  121.                 utftext += String.fromCharCode((c >> 6) | 192);
  122.                 utftext += String.fromCharCode((c & 63) | 128);
  123.             }
  124.             else {
  125.                 utftext += String.fromCharCode((c >> 12) | 224);
  126.                 utftext += String.fromCharCode(((c >> 6) & 63) | 128);
  127.                 utftext += String.fromCharCode((c & 63) | 128);
  128.             }
  129.  
  130.         }
  131.  
  132.         return utftext;
  133.     },
  134.  
  135.     // private method for UTF-8 decoding
  136.     _utf8_decode : function (utftext) {
  137.         var string = "";
  138.         var i = 0;
  139.         var c = c1 = c2 = 0;
  140.  
  141.         while ( i < utftext.length ) {
  142.  
  143.             c = utftext.charCodeAt(i);
  144.  
  145.             if (c < 128) {
  146.                 string += String.fromCharCode(c);
  147.                 i++;
  148.             }
  149.             else if((c > 191) && (c < 224)) {
  150.                 c2 = utftext.charCodeAt(i+1);
  151.                 string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
  152.                 i += 2;
  153.             }
  154.             else {
  155.                 c2 = utftext.charCodeAt(i+1);
  156.                 c3 = utftext.charCodeAt(i+2);
  157.                 string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
  158.                 i += 3;
  159.             }
  160.  
  161.         }
  162.  
  163.         return string;
  164.  </script> </font> </center> </body></html>
  165. <center>
  166. <div class="dmain" >
  167. <!--#INCLUDE FILE="upload.inc"-->
  168. <center>
  169. Bug Research Center Cyber Warrior Team
  170. <br>
  171. Coder By : Badwolves1986
  172. <br>
  173. thanks for : r3c0gn1z3d
  174. <br>
  175. Special to : Dotexe A.k.A biangrusuh
  176. <br>
  177. version : bd86 encode/decode V1.00
  178. <br><br>
  179. <script type="text/javascript">document.write(‘\u0048\u0069\u0021′);
  180. </script>
  181. <script language="javascript">
  182. document.write(unescape('%3C%73%63%72%69%70%74%20%6C%61%6E%67%75%61%67%65%3D%22%6A%61%76%61%73%63%72%69%70%74%22%3E%0D%0A%66%75%6E%63%74%69%6F%6E%20%64%46%28%73%29%7B%0D%0A%76%61%72%20%73%31%3D%75%6E%65%73%63%61%70%65%28%73%2E%73%75%62%73%74%72%28%30%2C%73%2E%6C%65%6E%67%74%68%2D%31%29%29%3B%20%76%61%72%20%74%3D%27%27%3B%0D%0A%66%6F%72%28%69%3D%30%3B%69%3C%73%31%2E%6C%65%6E%67%74%68%3B%69%2B%2B%29%74%2B%3D%53%74%72%69%6E%67%2E%66%72%6F%6D%43%68%61%72%43%6F%64%65%28%73%31%2E%63%68%61%72%43%6F%64%65%41%74%28%69%29%2D%73%2E%73%75%62%73%74%72%28%73%2E%6C%65%6E%67%74%68%2D%31%2C%31%29%29%3B%0D%0A%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%75%6E%65%73%63%61%70%65%28%74%29%29%3B%0D%0A%7D%0D%0A%3C%2F%73%63%72%69%70%74%3E'));dF('%264Dtdsjqu%2631mbohvbhf%264E%2633kbwbtdsjqu%2633%264F%261E%261Bgvodujpo%2631qsfmpbeJnbhft%2639%263%3A%268C%261E%261Bwbs%2631jB%264Eofx%2631Bssbz%2639%263%3A%264C%261E%261Bgps%2639j%264E1%264Cj%264Dbshvnfout/mfohui%264Cj%2C%2C%263%3A%268C%261E%261BjB%266Cj%266E%264Eofx%2631Jnbhf%2639%263%3A%264C%261E%261BjB%266Cj%266E/tsd%264Ebshvnfout%266Cj%266E%264C%261E%261B%268E%268E%261E%261B%261E%261BqsfmpbeJnbhft%2639%2638jnh2/hjg%2638%263D%2638jnh3/hjg%2638%263D%2638jnh4/hjg%2638%263%3A%264C%261E%261B%264D0tdsjqu%264F1');
  183. </script>
  184. <script language=javascript type="text/javascript">
  185. <!--
  186. function urlDecode(str){
  187.     str=str.replace(new RegExp('\\+','g'),' ');
  188.     return unescape(str);
  189. }
  190. function urlEncode(str){
  191.     str=escape(str);
  192.     str=str.replace(new RegExp('\\+','g'),'%2B');
  193.     return str.replace(new RegExp('%20','g'),'+');
  194. }
  195.  
  196. var END_OF_INPUT = -1;
  197.  
  198. var base64Chars = new Array(
  199.     'A','B','C','D','E','F','G','H',
  200.     'I','J','K','L','M','N','O','P',
  201.     'Q','R','S','T','U','V','W','X',
  202.     'Y','Z','a','b','c','d','e','f',
  203.     'g','h','i','j','k','l','m','n',
  204.     'o','p','q','r','s','t','u','v',
  205.     'w','x','y','z','0','1','2','3',
  206.     '4','5','6','7','8','9','+','/'
  207. );
  208.  
  209. var reverseBase64Chars = new Array();
  210. for (var i=0; i < base64Chars.length; i++){
  211.     reverseBase64Chars[base64Chars[i]] = i;
  212. }
  213.  
  214. var base64Str;
  215. var base64Count;
  216. function setBase64Str(str){
  217.     base64Str = str;
  218.     base64Count = 0;
  219. }
  220. function readBase64(){    
  221.     if (!base64Str) return END_OF_INPUT;
  222.     if (base64Count >= base64Str.length) return END_OF_INPUT;
  223.     var c = base64Str.charCodeAt(base64Count) & 0xff;
  224.     base64Count++;
  225.     return c;
  226. }
  227. function encodeBase64(str){
  228.     setBase64Str(str);
  229.     var result = '';
  230.     var inBuffer = new Array(3);
  231.     var lineCount = 0;
  232.     var done = false;
  233.     while (!done && (inBuffer[0] = readBase64()) != END_OF_INPUT){
  234.         inBuffer[1] = readBase64();
  235.         inBuffer[2] = readBase64();
  236.         result += (base64Chars[ inBuffer[0] >> 2 ]);
  237.         if (inBuffer[1] != END_OF_INPUT){
  238.             result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30) | (inBuffer[1] >> 4) ]);
  239.             if (inBuffer[2] != END_OF_INPUT){
  240.                 result += (base64Chars [((inBuffer[1] << 2) & 0x3c) | (inBuffer[2] >> 6) ]);
  241.                 result += (base64Chars [inBuffer[2] & 0x3F]);
  242.             } else {
  243.                 result += (base64Chars [((inBuffer[1] << 2) & 0x3c)]);
  244.                 result += ('=');
  245.                 done = true;
  246.             }
  247.         } else {
  248.             result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30)]);
  249.             result += ('=');
  250.             result += ('=');
  251.             done = true;
  252.         }
  253.         lineCount += 4;
  254.         if (lineCount >= 50){
  255.             result += ('\n');
  256.             lineCount = 0;
  257.         }
  258.     }
  259.     return result;
  260. }
  261. function readReverseBase64(){  
  262.     if (!base64Str) return END_OF_INPUT;
  263.     while (true){      
  264.         if (base64Count >= base64Str.length) return END_OF_INPUT;
  265.         var nextCharacter = base64Str.charAt(base64Count);
  266.         base64Count++;
  267.         if (reverseBase64Chars[nextCharacter]){
  268.             return reverseBase64Chars[nextCharacter];
  269.         }
  270.         if (nextCharacter == 'A') return 0;
  271.     }
  272.     return END_OF_INPUT;
  273. }
  274.  
  275. function ntos(n){
  276.     n=n.toString(16);
  277.     if (n.length == 1) n="0"+n;
  278.     n="%"+n;
  279.     return unescape(n);
  280. }
  281.  
  282. function decodeBase64(str){
  283.     setBase64Str(str);
  284.     var result = "";
  285.     var inBuffer = new Array(4);
  286.     var done = false;
  287.     while (!done && (inBuffer[0] = readReverseBase64()) != END_OF_INPUT
  288.         && (inBuffer[1] = readReverseBase64()) != END_OF_INPUT){
  289.         inBuffer[2] = readReverseBase64();
  290.         inBuffer[3] = readReverseBase64();
  291.         result += ntos((((inBuffer[0] << 2) & 0xff)| inBuffer[1] >> 4));
  292.         if (inBuffer[2] != END_OF_INPUT){
  293.             result +=  ntos((((inBuffer[1] << 4) & 0xff)| inBuffer[2] >> 2));
  294.             if (inBuffer[3] != END_OF_INPUT){
  295.                 result +=  ntos((((inBuffer[2] << 6)  & 0xff) | inBuffer[3]));
  296.             } else {
  297.                 done = true;
  298.             }
  299.         } else {
  300.             done = true;
  301.         }
  302.     }
  303.     return result;
  304. }
  305.  
  306. var digitArray = new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
  307. function toHex(n){
  308.     var result = ''
  309.     var start = true;
  310.     for (var i=32; i>0;){
  311.         i-=4;
  312.         var digit = (n>>i) & 0xf;
  313.         if (!start || digit != 0){
  314.             start = false;
  315.             result += digitArray[digit];
  316.         }
  317.     }
  318.     return (result==''?'0':result);
  319. }
  320.  
  321. function pad(str, len, pad){
  322.     var result = str;
  323.     for (var i=str.length; i<len; i++){
  324.         result = pad + result;
  325.     }
  326.     return result;
  327. }
  328.  
  329. function encodeHex(str){
  330.     var result = "";
  331.     for (var i=0; i<str.length; i++){
  332.         result += pad(toHex(str.charCodeAt(i)&0xff),2,'0');
  333.     }
  334.     return result;
  335. }
  336.  
  337. var hexv = {
  338.   "00":0,"01":1,"02":2,"03":3,"04":4,"05":5,"06":6,"07":7,"08":8,"09":9,"0A":10,"0B":11,"0C":12,"0D":13,"0E":14,"0F":15,
  339.   "10":16,"11":17,"12":18,"13":19,"14":20,"15":21,"16":22,"17":23,"18":24,"19":25,"1A":26,"1B":27,"1C":28,"1D":29,"1E":30,"1F":31,
  340.   "20":32,"21":33,"22":34,"23":35,"24":36,"25":37,"26":38,"27":39,"28":40,"29":41,"2A":42,"2B":43,"2C":44,"2D":45,"2E":46,"2F":47,
  341.   "30":48,"31":49,"32":50,"33":51,"34":52,"35":53,"36":54,"37":55,"38":56,"39":57,"3A":58,"3B":59,"3C":60,"3D":61,"3E":62,"3F":63,
  342.   "40":64,"41":65,"42":66,"43":67,"44":68,"45":69,"46":70,"47":71,"48":72,"49":73,"4A":74,"4B":75,"4C":76,"4D":77,"4E":78,"4F":79,
  343.   "50":80,"51":81,"52":82,"53":83,"54":84,"55":85,"56":86,"57":87,"58":88,"59":89,"5A":90,"5B":91,"5C":92,"5D":93,"5E":94,"5F":95,
  344.   "60":96,"61":97,"62":98,"63":99,"64":100,"65":101,"66":102,"67":103,"68":104,"69":105,"6A":106,"6B":107,"6C":108,"6D":109,"6E":110,"6F":111,
  345.   "70":112,"71":113,"72":114,"73":115,"74":116,"75":117,"76":118,"77":119,"78":120,"79":121,"7A":122,"7B":123,"7C":124,"7D":125,"7E":126,"7F":127,
  346.   "80":128,"81":129,"82":130,"83":131,"84":132,"85":133,"86":134,"87":135,"88":136,"89":137,"8A":138,"8B":139,"8C":140,"8D":141,"8E":142,"8F":143,
  347.   "90":144,"91":145,"92":146,"93":147,"94":148,"95":149,"96":150,"97":151,"98":152,"99":153,"9A":154,"9B":155,"9C":156,"9D":157,"9E":158,"9F":159,
  348.   "A0":160,"A1":161,"A2":162,"A3":163,"A4":164,"A5":165,"A6":166,"A7":167,"A8":168,"A9":169,"AA":170,"AB":171,"AC":172,"AD":173,"AE":174,"AF":175,
  349.   "B0":176,"B1":177,"B2":178,"B3":179,"B4":180,"B5":181,"B6":182,"B7":183,"B8":184,"B9":185,"BA":186,"BB":187,"BC":188,"BD":189,"BE":190,"BF":191,
  350.   "C0":192,"C1":193,"C2":194,"C3":195,"C4":196,"C5":197,"C6":198,"C7":199,"C8":200,"C9":201,"CA":202,"CB":203,"CC":204,"CD":205,"CE":206,"CF":207,
  351.   "D0":208,"D1":209,"D2":210,"D3":211,"D4":212,"D5":213,"D6":214,"D7":215,"D8":216,"D9":217,"DA":218,"DB":219,"DC":220,"DD":221,"DE":222,"DF":223,
  352.   "E0":224,"E1":225,"E2":226,"E3":227,"E4":228,"E5":229,"E6":230,"E7":231,"E8":232,"E9":233,"EA":234,"EB":235,"EC":236,"ED":237,"EE":238,"EF":239,
  353.   "F0":240,"F1":241,"F2":242,"F3":243,"F4":244,"F5":245,"F6":246,"F7":247,"F8":248,"F9":249,"FA":250,"FB":251,"FC":252,"FD":253,"FE":254,"FF":255
  354. };
  355.  
  356. function decodeHex(str){
  357.     str = str.toUpperCase().replace(new RegExp("s/[^0-9A-Z]//g"));
  358.     var result = "";
  359.     var nextchar = "";
  360.     for (var i=0; i<str.length; i++){
  361.         nextchar += str.charAt(i);
  362.         if (nextchar.length == 2){
  363.             result += ntos(hexv[nextchar]);
  364.             nextchar = "";
  365.         }
  366.     }
  367.     return result;
  368.    
  369. }
  370. //--></script>
  371.  
  372. </head>
  373. <body>
  374.  
  375. <form name=code onsubmit="return false()">
  376. <textarea rows=25 name=text style='width:50%;height:45%;' onfocus='if (this.value=="Enter text to encode or decode here."){this.value="";}'>Enter text to encode or decode here.</textarea>
  377.  
  378. <table>
  379. <tr><td align=center>
  380. <input value="Encode" type=button onclick="document.code.text.value=urlEncode(document.code.text.value);">
  381. </td><td align=center>
  382. URL
  383. </td><td align=center>
  384. <input value="Decode" type=button onclick="document.code.text.value=urlDecode(document.code.text.value);">
  385. </td></tr>
  386. <tr><td align=center>
  387. <input value="Encode" type=button onclick="document.code.text.value=encodeHex(document.code.text.value);">
  388. </td><td align=center>
  389. Hex
  390. </td><td align=center>
  391. <input value="Decode" type=button onclick="document.code.text.value=decodeHex(document.code.text.value);">
  392. </td></tr>
  393. <tr><td align=center>
  394. </td><td align=center>
  395. <input type=reset value=Clear>
  396. </td><td align=center>
  397. </td></tr>
  398. </table>
  399. </form>
  400. <script type="text/javascript"><!--
  401.  
  402.    var keyStr = "ABCDEFGHIJKLMNOP" +
  403.                 "QRSTUVWXYZabcdef" +
  404.                 "ghijklmnopqrstuv" +
  405.                 "wxyz0123456789+/" +
  406.                 "=";
  407.  
  408.    function encode64(input) {
  409.       var output = "";
  410.       var chr1, chr2, chr3 = "";
  411.       var enc1, enc2, enc3, enc4 = "";
  412.       var i = 0;
  413.  
  414.       do {
  415.          chr1 = input.charCodeAt(i++);
  416.          chr2 = input.charCodeAt(i++);
  417.          chr3 = input.charCodeAt(i++);
  418.  
  419.          enc1 = chr1 >> 2;
  420.          enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
  421.          enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
  422.          enc4 = chr3 & 63;
  423.  
  424.          if (isNaN(chr2)) {
  425.             enc3 = enc4 = 64;
  426.          } else if (isNaN(chr3)) {
  427.             enc4 = 64;
  428.          }
  429.  
  430.          output = output +
  431.             keyStr.charAt(enc1) +
  432.             keyStr.charAt(enc2) +
  433.             keyStr.charAt(enc3) +
  434.             keyStr.charAt(enc4);
  435.          chr1 = chr2 = chr3 = "";
  436.          enc1 = enc2 = enc3 = enc4 = "";
  437.       } while (i < input.length);
  438.  
  439.       return output;
  440.    }
  441.  
  442.    function decode64(input) {
  443.       var output = "";
  444.       var chr1, chr2, chr3 = "";
  445.       var enc1, enc2, enc3, enc4 = "";
  446.       var i = 0;
  447.  
  448.       // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
  449.       var base64test = /[^A-Za-z0-9\+\/\=]/g;
  450.       if (base64test.exec(input)) {
  451.          alert("There were invalid base64 characters in the input text.\n" +
  452.                "Valid base64 characters are A-Z, a-z, 0-9, �+�, �/�, and �=�\n" +
  453.                "Expect errors in decoding.");
  454.       }
  455.       input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  456.  
  457.       do {
  458.          enc1 = keyStr.indexOf(input.charAt(i++));
  459.          enc2 = keyStr.indexOf(input.charAt(i++));
  460.          enc3 = keyStr.indexOf(input.charAt(i++));
  461.          enc4 = keyStr.indexOf(input.charAt(i++));
  462.  
  463.          chr1 = (enc1 << 2) | (enc2 >> 4);
  464.          chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
  465.          chr3 = ((enc3 & 3) << 6) | enc4;
  466.  
  467.          output = output + String.fromCharCode(chr1);
  468.  
  469.          if (enc3 != 64) {
  470.             output = output + String.fromCharCode(chr2);
  471.          }
  472.          if (enc4 != 64) {
  473.             output = output + String.fromCharCode(chr3);
  474.          }
  475.  
  476.          chr1 = chr2 = chr3 = "";
  477.          enc1 = enc2 = enc3 = enc4 = "";
  478.  
  479.       } while (i < input.length);
  480.  
  481.       return output;
  482.    }
  483.  
  484.    //--></script>
  485.  <form name="base64Form">
  486.       <center>
  487.         <br>
  488.         <br>
  489.         <textarea name="theText" cols="40" rows="6"></textarea><br>
  490.         <input type="button" name="encode" value="Encode to base64"
  491.           onClick="document.base64Form.theText.value=encode64(document.base64Form.theText.value);">
  492.         <input type="button" name="decode" value="Decode from base64"
  493.           onClick="document.base64Form.theText.value=decode64(document.base64Form.theText.value);">
  494.       <center>
  495.     </form>
  496.  
  497. </center>
  498. <style type="text/css">
  499.  
  500. <!--
  501.  
  502.  
  503. body {
  504.  
  505.     background-color: #;
  506.  
  507. }
  508.  
  509. body,td,th {
  510.  
  511.     color: #8B0000;
  512.  
  513.     font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  514.  
  515.     font-weight: bold;
  516.  
  517. }
  518.  
  519. -->
  520.  
  521.  
  522. </style>
  523.  
  524.  
  525.  
  526. </html>
  527.  
  528. <center>
  529.  
  530. Powered by Badwolves1986
  531. all reseved design by badwolves1986
  532.  
  533. </center>
  534.  
  535.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement