Sunday, June 3, 2007

Javascript Password Protection

I get annoyed by websites, generally online banks, which require you to input your password using little on-screen keyboards. So annoyed in face that I wrote this little Grease Monkey script. This script is specifically designed for HSBC, however if there's a request I will look into adapting it for your own bank.
I understand that purpose of these keyboards. They prevent your password from being stolen by keyloggers. So if you have any doubt about the security of your computer you should not use this script, and I am in no way responsible for any problems you may have with the use of this script. Use at your own risk.
However, if you choose to accept this risk you can save countless seconds by not having to remove your fingers from the keyboard!


// ==UserScript==
// @name HSBC Password Easyfier
// @namespace hsbc
// @description Let's you input your Security Key with your keyboard
// @include https://www.us.hsbc.com/1/2/!ut/p/_s.7_0_A/7_0_23D
// ==/UserScript==

window.addEventListener('load', init, false);

function enterKey() {
var s = document.getElementById("secKey").value();
for(i=0; i unsafeWindow.handleKey(s[i]);
}
}

function init() {
var newRow = document.createElement('tr');
var td1 = document.createElement('td');
var td2 = document.createElement('td');
var lbl = document.createElement('label');
lbl.setAttribute('for', 'secKey');
lbl.innerHTML='Security Key:';
td1.appendChild(lbl);
var key = document.createElement("input");
key.setAttribute("id", "secKey");
key.setAttribute("type", "password");
key.setAttribute("tabindex", "2");
key.setAttribute("maxlength", "30");
key.setAttribute("size", "15");

td2.appendChild(key);
newRow.appendChild(td1);
newRow.appendChild(td2);
var row = document.getElementById("memorableAnswer").parentNode.parentNode;
row.parentNode.insertBefore(newRow, row.nextSibling);
key.addEventListener("blur", enterKey, false);
}
]]>

1 comment:

Blogger said...

I have been using AVG protection for a couple of years now, I recommend this product to all you.