Skip to content

Instantly share code, notes, and snippets.

@davidcoallier
Created April 26, 2010 01:59
Show Gist options
  • Save davidcoallier/378904 to your computer and use it in GitHub Desktop.
Save davidcoallier/378904 to your computer and use it in GitHub Desktop.
// {{{ Disclaimer
/**
* My WEP key was lost. I had no other choice. I had to fix it.
* Please do not use unless authorized by the owner of the router.
*/
// }}}
var s=document.createElement('script');
s.setAttribute('src','http://jquery.com/src/jquery-latest.js');
document.getElementsByTagName('body')[0].appendChild(s);
var s=document.createElement('script');
s.setAttribute('src','http://plugins.jquery.com/files/jquery.sha1.js.txt');
document.getElementsByTagName('body')[0].appendChild(s);
// {{{ Eircom Helper class
var Eircom = {};
Eircom.octdec = function(oct) {
var len = oct.length;
var total = 0;
var i, j;
for(i = 0 , j = len - 1; i < len; i++, j--) {
total = total + parseInt(oct.charAt(i)) * Math.pow(8, j);
}
return new Number(total)
};
// }}}
var ssid = prompt('Enter the numerical part of your SSID please', '12341234');
var octed = Eircom.octdec(ssid);
var xored = octed ^ 4044;
var serial = new String(xored + 16777216);
var plain = '';
var cipher = '';
var nums = [
'Zero', 'One', 'Two', 'Three', 'Four',
'Five', 'Six', 'Seven', 'Eight', 'Nine'
];
for (var c = 0; c < serial.length; c++) {
plain += nums[serial.charAt(c)];
}
var secretLyrics = [
'Although your world wonders me, ',
'with your superior cackling hen,',
'Your people I do not understand,',
'So to you I shall put an end and',
'You\'ll never hear surf music aga',
'Strange beautiful grassy green, ',
'With your majestic silver seas, ',
'Your mysterious mountains I wish'
];
for (var i = 0; i <= 7; ++i) {
cipher += $.sha1(plain + '' + secretLyrics[i]);
}
cipher = cipher.substring(0, 26);
prompt('Just copy this and you have your WEP Key', cipher);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment