vendredi 9 octobre 2015

Bookmarklet for password


It's friday,


Today we create a stupid bookmarklet for having no more 100 passwords to remind :

javascript:(function () { var ps = document.querySelector("input[type='password']"); var p = ps.value; var h = window.location.hostname.match(/[^.]*\.[^.]*$/)[0]; if (p !== undefined) { var t = ""; for (var i = 0; i < 10; i++) { var e = (p.charCodeAt(i % p.length) ^ h.charCodeAt(i % h.length) ^ i); t += String.fromCharCode(i < 3 ? 97 + e % 26 : i < 5 ? 65 + e % 26 : i < 7 ? 35 + e % 4 : 48 + e % 10); } console.log(t); Array.prototype.forEach.call(document.querySelectorAll("input[type='password']"), function (d) { d.value = t; }); }})();


You type your password on the first password input of a webpage and it generates a hash with the hostname (ex google.com) and the password you initially typed.
The bookmarklet puts the new hashed password on all relevant inputs and on the console if you want to print it on a T-shirt



Aucun commentaire :

Enregistrer un commentaire