Guest User

psi

a guest
Jan 9th, 2017
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.00 KB | None | 0 0
  1. <html><head><script>
  2. function decodePassword(pass, key){
  3. var result ="";
  4. var n1, n2;
  5. if(key.length ==0)
  6. return pass;
  7. for(n1 =0, n2 =0; n1 < pass.length; n1 +=4){
  8. if(n1 +4> pass.length)
  9. break;
  10. result +=String.fromCharCode(Number("0x"+pass.substr(n1,4))^ key.charCodeAt(n2++));
  11. if(n2 >= key.length)
  12. n2 =0;
  13. }
  14. return result;}function escapeHtml(html){
  15. return html.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");}function tryDecode(){
  16. var pass
  17. try{
  18. pass = decodePassword(document.getElementById("encoded").value, document.getElementById("jid").value);
  19. }catch(e){
  20. pass ="Encode failed: "+ e
  21. }
  22. document.getElementById("result").innerHTML = escapeHtml(pass);}
  23. </script></head><body>
  24. <table><tr><td>JID: </td><td><input id='jid'/></td></tr><tr><td>Encoded password: </td><td><input id='encoded'/></td></tr><tr><td>Result: </td><td id='result'></td></tr><tr><td colspan='2'style='text-align:right'><input type='button'value="decode"onclick="tryDecode()"/></td></tr></table>
  25. </body></html>
Advertisement
Add Comment
Please, Sign In to add comment