...

Random "Pronouncable" Password Generator

redhead
07-29-2002, 06:43 PM
After looking at this password generator (http://www.javascriptkit.com/script/script2/passwordgenerate.shtml) and thinking "how on earth do i remember that" i thought it would be easier to remember something that is "sayable".

this script lists the basic elements of a word and chooses a random word structure to make the word pronouncable... or... at least 50% of them ;). I'm sure there is a way to do this to cut down on the code... but here goes anyway...


<script>

/****************************************
* *
* Random "Pronouncable" Password Script *
* *
****************************************/

var letters = "bcdfghjklmnprstvwxyz";
var vowels = "aeiou";

groups = new Array();
groups[0]="th";
groups[1]="ch";
groups[2]="sh";
// groups[3]="qu";

function generate(number) {

// randomize letters

var vowel1 = vowels.charAt(Math.floor(Math.random()*vowels.length));
var group1 = groups[Math.floor(Math.random()*groups.length)];
var letter1 = letters.charAt(Math.floor(Math.random()*letters.length));
var vowel2 = vowels.charAt(Math.floor(Math.random()*vowels.length));
var group2 = groups[Math.floor(Math.random()*groups.length)];
var letter2 = letters.charAt(Math.floor(Math.random()*letters.length));
var vowel3 = vowels.charAt(Math.floor(Math.random()*vowels.length));
var group3 = groups[Math.floor(Math.random()*groups.length)];
var letter3 = letters.charAt(Math.floor(Math.random()*letters.length));
var vowel4 = vowels.charAt(Math.floor(Math.random()*vowels.length));
var group4 = groups[Math.floor(Math.random()*groups.length)];
var letter4 = letters.charAt(Math.floor(Math.random()*letters.length));

// specify the structure of the words (in order for them to be pronouncable)
// feel free to add your own...

structure = new Array();
structure[0]=letter1+vowel1+letter2+letter3+vowel2+letter4+vowel3+group1;
structure[1]=group1+vowel1+letter1+letter2+vowel2+letter3;
structure[2]=group1+vowel1+letter1+letter2+vowel2+group2;
structure[3]=group1+vowel1+letter1+vowel2+"s";
structure[4]=vowel1+group1+vowel2+letter1+vowel3;
structure[5]=group1+vowel1+letter1+vowel2+group2;
structure[6]=vowel1+group1+vowel2+letter1;

var password=structure[Math.floor(Math.random()*structure.length)];

if (number==1) {
document.passform.passbox.value=password+Math.floor(Math.random()*100)
}
else {
document.passform.passbox.value=password;
}
}
window.onload=generate
</script>

<div align="center">

<table>
<tr>
<td colspan="2" align="center" style="font-family: verdana; font-size: 12pt; font-weight: bold;">
Random "Pronouncable" Password Generator
</td>
</tr>
<tr>
<td>
<form name="passform">
<input type="text" name="passbox" style="font-family: verdana;" onfocus="this.select()" /><br>
</td>
<td>
<input type="button" value="Generate! (Words Only)" onclick="generate(0)" style="font-family: verdana" />
<td>
</tr>
<tr>
<td>
&nbsp;
</td>
<td>
<input type="button" value="Generate! (With Number)" onclick="generate(1)" style="font-family: verdana" />
</form>
</td>
</tr>
</table>
</div>


or you could see a working demo (http://www.btinternet.com/~chriscaws/password2.html).

Okay... so not all of the words are sayable... and none of them make sense... but even if you dont use it as a password generator... you could have hours of fun trying to say them :D

any ideas / improvements / shortenings will be appreciated :thumbsup:

Philip M
08-05-2002, 06:51 PM
I have seen a variant of this which generates much more "pronouncable" passwords of eight characters -

consonant - vowel - consonant - vowel - consonant - vowel - consonant - vowel

e.g. votohubo tofesuma redahedu

As each syllable represents 20 x 5 = 100 numbers, an eight-letter
password is 1 of 100 million (10 to the fourth) possibles.

redhead
08-08-2002, 06:34 PM
not hard. i made it so you could add your own structures... you could just add in this....

structure[7]=letter1+vowel1+letter2+vowel2+letter3+vowel3+letter4+vowel4

tonynoname123
12-19-2009, 06:26 AM
If anyone wants to see what it looks like without logging in to that yahoo thing, goto www.7324.tk (http://www.7324.tk) I just pasted the code in there so you can see it. it's good, but I would reccomend...


<script language="javascript" type="text/javascript">
function randomString() {
var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var string_length = 10;
var randomstring = '';
for (var i=0; i<string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum,rnum+1);
}
document.randform.randomfield.value = randomstring;
}
</script>
<form name="randform">
<input type="button" value="Randomize!" onClick="randomString();">&nbsp;
<input type="text" name="randomfield" value="NO-NAME!">
</form>


Which looks like this: www.7325.tk (http://www.7325.tk)
:)

mr.jsnerd
12-20-2009, 02:35 AM
nice.. but i dont think that 8vn is pronouceble. i would remove the numbers.
with a little more testing, this would be awesome.

tonynoname123
12-20-2009, 04:54 AM
who are you saying that to? me or him?
if you want to remove the numbers, just take them out in your script...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum