📜 ⬆️ ⬇️

Javascript Password Generator

image
The password generator provided creates relatively easy to remember and, at the same time, hard to pick up passwords. The basic idea is that passwords are generated based on syllables and therefore look like words or phrases. For better memorization, capital letters are used at the beginning of each syllable.

Project on Google.Code:
code.google.com/p/jspassgen/downloads/list
An example of work can be found here:
business books .rus / ext / jspassgen / example.html

It was based on a slightly different algorithm, well described by the author, Sergei Mikhailovich Sveshnikov:
“Syllables were composed of one vowel and one consonant letter, arranged randomly relative to each other. Random letters in the password were capitalized. Some syllables were separated by numbers, and the number of numbers was always even (but by chance and not more than half). The numbers could stand in pairs. The result was a password of a given length, quite beautiful and complex. The number of characters was even (well, I liked it so much) "

This algorithm does not fix the number of characters in the password, and is designed for practical use as a list of random passwords offered to the user, for example, during registration, allowing, if desired, changing the complexity of the password by adjusting the number of syllables.
There is also a mechanism for regulating the number of digits in the proposed passwords, by introducing the numProb coefficient and its step to reduce the likelihood of digits appearing with each new syllable.
')
<style> .jsPassGenWrapper { width:300px; height:180px; padding:10px; border:1px solid #aaa; } .jsPassGenWrapper #jsPassGenForm { float:left; width:50%; font-size:16px; font-family:Courier, serif; } .jsPassGenWrapper .jsPassGenCtrls { float:right; width:50%; margin-top:100px; } .jsPassGenWrapper input { padding:0px 10px; } </style> <div class="jsPassGenWrapper"> <div id="jsPassGenForm"></div> <div class="jsPassGenCtrls"> <input type="checkbox" id="jsPassGenUseNumsCB" checked="checked" /> <label for="jsPassGenUseNumsCB">Use numbers</label><br /> <input type="button" value="Create password" onClick="runPassGen()" /> </div> <script type="text/javascript"> /* @param id -     ) @param syllableNum -     @param numPass -       @param useNums -     */ function jsPassGen(id, syllableNum, numPass, useNums) { id = typeof(id) != 'undefined' ? id : 'jsPassGenForm'; //    syllableNum = typeof(syllableNum) != 'undefined' ? syllableNum : 3; numPass = typeof(numPass) != 'undefined' ? numPass : 10; useNums = typeof(useNums) != 'undefined' ? useNums : true; function rand(from, to) { from = typeof(from) != 'undefined' ? from : 0; //  to = typeof(to) != 'undefined' ? to : from + 1; //   return Math.round(from + Math.random()*(to - from)); }; function getRandChar(a) { return a.charAt(rand(0,a.length-1)); } var form = document.getElementById(id); //          var cCommon = "bcdfghklmnprstvz"; var cAll = cCommon + "jqwx"; //   var vAll = "aeiouy"; //   var lAll = cAll + vAll; //   form.innerHTML = ""; for(var j = 0; j < numPass; ++j) { //        var numProb = 0, numProbStep = 0.25; for(var i = 0; i < syllableNum; ++i) { if(Math.round(Math.random())) { form.innerHTML += getRandChar(cCommon).toUpperCase() + getRandChar(vAll) + getRandChar(lAll); } else { form.innerHTML += getRandChar(vAll).toUpperCase() + getRandChar(cCommon); } if(useNums && Math.round(Math.random() + numProb)) { form.innerHTML += rand(0,9); numProb += numProbStep; } } form.innerHTML += "<br />"; } return false; } function runPassGen() { jsPassGen('jsPassGenForm', 3, 10, jsPassGenUseNumsCB.checked); } runPassGen(); </script> </div> 


PS: Bright thoughts from the comments:
Recommended password generators:
password.nanohertz.net
genpas.narod.ru
pwgen-win.sourceforge.net
genpas.ru

And one nick generator%):
mbeaver.narod.ru/nicks

Sicness # :
the idea reduces the entropy of the password and, as a result, is not worth using everywhere.

docomo # :
... The password generated on js is offered to the user as one of the options directly in the registration form, while the password created on the server is forced.

gonzazoid # :
IMHO of the most memorable techniques most reliable - the technique of shocking absurdity. Mollusc passwords have bitten off my dancing genitals. I repeat - it is from memorized. Described here www.ozon.ru/context/detail/id/855490

Source: https://habr.com/ru/post/108509/


All Articles