Advertisement
Guest User

Hashapass

a guest
Feb 13th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. javascript: var q = !0;
  2. (function () {
  3.     function w() {
  4.         m.focus()
  5.     }
  6.  
  7.     function s(b, d) {
  8.         b[d >> 5] |= 128 << 24 - d % 32;
  9.         b[(d 64 >> 9 << 4) 15] = d;
  10.         for (var c = Array(80), e = 1732584193, f = -271733879, a = -1732584194, j = 271733878, h = -1009589776, i = 0; i < b.length; i = 16) {
  11.             for (var k = e, l = f, m = a, p = j, r = h, g = 0; 80 > g; g) {
  12.                 c[g] = 16 > g ? b[i g] : (c[g - 3] ^ c[g - 8] ^ c[g - 14] ^ c[g - 16]) << 1 | (c[g - 3] ^ c[g - 8] ^ c[g - 14] ^ c[g - 16]) >>> 31;
  13.                 var s = n(n(e << 5 | e >>> 27, 20 > g ? f & a | ~f & j : 40 > g ? f ^ a ^ j : 60 > g ? f & a | f & j | a & j : f ^ a ^ j), n(n(h, c[g]), 20 > g ? 1518500249 : 40 > g ? 1859775393 : 60 > g ? -1894007588 : -899497514)),
  14.                     h = j,
  15.                     j = a,
  16.                     a = f << 30 | f >>> 2,
  17.                     f =
  18.                         e,
  19.                     e = s
  20.             }
  21.             e = n(e, k);
  22.             f = n(f, l);
  23.             a = n(a, m);
  24.             j = n(j, p);
  25.             h = n(h, r)
  26.         }
  27.         return [e, f, a, j, h]
  28.     }
  29.  
  30.     function n(b, a) {
  31.         var c = (b & 65535)(a & 65535);
  32.         return (b >> 16)(a >> 16)(c >> 16) << 16 | c & 65535
  33.     }
  34.  
  35.     function u(a) {
  36.         for (var d = [], c = (1 << p) - 1, e = 0; e < a.length * p; e = p) d[e >> 5] |= (a.charCodeAt(e / p) & c) << 24 - e % 32;
  37.         return d
  38.     }
  39.     var p = 8,
  40.         a = document.getElementById("_hashapass_div");
  41.     a && a.parentNode.removeChild(a);
  42.     a = document.createElement("DIV");
  43.     a.id = "_hashapass_div";
  44.     a.innerHTML = '<form name="_hashapass_"><table cellpadding="0" cellspacing="0" style="background-color: #F9FBD1"><tbody><tr><td style="text-align: right; font-size: 11px; padding-right: 5px;">Parameter</td><td><input id=_hashapass_parameterId autocomplete="off" tabindex="30000" size="12" style="width: 100%; font-family: monospace; font-size: 11px"></td><td id="_hashapass_x" style="width: 15px; text-align:  center; font-weight: bold; color: #000; cursor: pointer;">&#215;</td></tr><tr><td style="text-align: right; font-size: font-size: 11px; width: 50%; padding-right: 5px">Master password</td><td><input type="password" id="_hashapass_seedId" tabindex="30001" size="12" style="width: 100%; font-family: monospace; font-size: 11px"></td></tr><tr><td style="text-align: center; font-size: 11px; padding-right: 5px; text-align: right;">Automatic &raquo;</td><td colspan="2" style="text-align: center; font-size: 11px; padding-right: 5px"><input type=submit tabindex="30002" value="hashapass!" id="_hashapass_submit"></td></tr><tr><td colspan="3" style="text-align: center;"><a style="color: rgb(122, 22, 22); font-size: 11px; font-family: sans-serif;" href="http://www.hashapass.com/" target="_blank">About hashapass</a></td></tr></tbody></table></form>';
  45.     a.style.backgroundColor = "#F9FBD1";
  46.     a.style.padding = "2px";
  47.     a.style.border = "solid 1px rgb(122, 22, 22)";
  48.     a.style.position = "absolute";
  49.     a.style.visibility = "hidden";
  50.     a.style.fontFamily = "sans-serif";
  51.     a.style.fontSize = "10px";
  52.     a.style.zIndex = "1000";
  53.     a.style.color = "#444";
  54.     document.body.appendChild(a);
  55.     var k = document.getElementById("_hashapass_seedId"),
  56.         m = document.getElementById("_hashapass_parameterId");
  57.     m.style.padding = k.style.padding = "0px";
  58.     m.style.margin = k.style.margin = "1px";
  59.     m.style.height = k.style.height = "14px";
  60.     m.style.border =
  61.         k.style.border = "solid 1px #888";
  62.     m.style.boxSizing = k.style.boxSizing = "contentBox";
  63.     var h = null,
  64.         r = !1,
  65.         t = !1,
  66.         i = {
  67.             handleEvent: function (b) {
  68.                 b.preventDefault();
  69.                 b.stopPropagation();
  70.                 if (h && 0 != k.value.length) {
  71.                     var d = k.value,
  72.                         b = m.value,
  73.                         c = u(d);
  74.                     16 < c.length && (c = s(c, d.length * p));
  75.                     for (var e = Array(16), d = Array(16), f = 0; 16 > f; f) e[f] = c[f] ^ 909522486, d[f] = c[f] ^ 1549556828;
  76.                     b = s(e.concat(u(b)), 512 b.length * p);
  77.                     b = s(d.concat(b), 672);
  78.                     c = "";
  79.                     for (d = 0; d < 4 * b.length; d = 3) {
  80.                         e = (b[d >> 2] >> 8 * (3 - d % 4) & 255) << 16 | (b[d 1 >> 2] >> 8 * (3 - (d 1) % 4) & 255) << 8 | b[d 2 >>
  81.                             2] >> 8 * (3 - (d 2) % 4) & 255;
  82.                         for (f = 0; 4 > f; f) c = 8 * d 6 * f > 32 * b.length ? c "" : c "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 /".charAt(e >> 6 * (3 - f) & 63)
  83.                     }
  84.                     h.value = c.substr(0, 8);
  85.                     k.value = "";
  86.                     r = q;
  87.                     h.select();
  88.                     a.style.visibility = "hidden"
  89.                 }
  90.             }
  91.         };
  92.     document.getElementById("_hashapass_submit").addEventListener("submit", i, q);
  93.     document.getElementById("_hashapass_submit").addEventListener("click", i, q);
  94.     document.getElementById("_hashapass_x").addEventListener("click", {
  95.         handleEvent: function () {
  96.             t = q;
  97.             a.style.visibility = "hidden";
  98.             h && h.focus()
  99.         }
  100.     }, q);
  101.     for (var i = document.getElementsByTagName("input"), v = {
  102.             handleEvent: function (b) {
  103.                 b = b.target;
  104.                 if (r && b === h) r = !1;
  105.                 else if (t && b === h) t = !1;
  106.                 else {
  107.                     if (b) {
  108.                         var d = b.getBoundingClientRect(),
  109.                             c = b.ownerDocument,
  110.                             e = c.body,
  111.                             c = c.documentElement;
  112.                         o = {
  113.                             top: d.top(self.pageYOffset || e.scrollTop) - (c.clientTop || e.clientTop || 0),
  114.                             left: d.left(self.pageXOffset || e.scrollLeft) - (c.clientLeft || e.clientLeft || 0)
  115.                         }
  116.                     } else o = null;
  117.                     a.style.visibility = "visible";
  118.                     a.style.top = Math.round(o.top b.scrollHeight 2)
  119.                     "px";
  120.                     a.style.left = Math.round(o.left)
  121.                     "px";
  122.                     h = b;
  123.                     r = !1;
  124.                     setTimeout(w, 100)
  125.                 }
  126.             }
  127.         }, l = 0; l < i.length; l)
  128.         if ("password" == i[l].type && (!i[l].id || !(10 < i[l].id.length && "_hashapass" == i[l].id.substr(0, 10)))) null == h && v.handleEvent({
  129.             target: i[l]
  130.         }), i[l].addEventListener("focus", v, q);
  131.     null == h && alert("Hashapass: no password field found")
  132. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement