Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random "Pronouncable" Password Generator

    After looking at this password generator 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...

    Code:
    <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.

    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

    any ideas / improvements / shortenings will be appreciated
    Last edited by redhead; 07-29-2002 at 06:45 PM.
    redhead

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    redhead

  • #4
    New Coder
    Join Date
    Nov 2009
    Location
    www.nn11.darkbb.com
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile code view

    If anyone wants to see what it looks like without logging in to that yahoo thing, goto www.7324.tk I just pasted the code in there so you can see it. it's good, but I would reccomend...


    Code:
    <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
    :)

  • #5
    New Coder
    Join Date
    Dec 2009
    Posts
    38
    Thanks
    3
    Thanked 0 Times in 0 Posts

    nice but...

    nice.. but i dont think that 8vn is pronouceble. i would remove the numbers.
    with a little more testing, this would be awesome.

  • #6
    New Coder
    Join Date
    Nov 2009
    Location
    www.nn11.darkbb.com
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts
    who are you saying that to? me or him?
    if you want to remove the numbers, just take them out in your script...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •