Today I’ll be sharing an algorithm that I use quite a lot, for generating passwords that are easily memorable and spelled - one may also call this type of passwords mnemonic passwords.
Here is what the algorithm does:
- Given a number requested letters, the algorithm will alternately and randomly pick vowels and consonants (starting with a consonant) until it reaches the requested number of letters.
- If any dirty word is found on the generated string, the process starts all over again.
- Given a number of requested numbers, the algorithm will randomly pick numbers until it reaches the requested number of numbers. If the requested number of numbers is negative, the generated numbers will be prepended instead of being appended to the rest of the string.
- This algorithm can generate arbitrary-lengh passwords.
This algorithm can generate passwords like the following ones:
- focopu93
- fetowo75
- qaxedu41
- powize70
I’ve had some of my clients thanking me for generating such easy-to-remember passwords in their web sites, maybe this turns out to be useful to you too… If it does drop me a line.
You can get the source code here or try a live example here.
You do some pretty useful stuff, I also think that mnemonic passwords are better for remembering.
Thank you for your nice little function here. Just wanted to let you know that it’s been helpful on Ebyte.com for our password reset page.
Nice one.
Just try to give an option of testing this online. like dome or something which will help the non technical users.
Thanks for your feedback, I’ve just made a live example avaliable - check the link on the post.
Hi,
Was looking for a way to make these easy-to-remember passwords. Thanks for the tip about alternating vowels and consonants.
As I just need an 8 character password with no numbers (and am not concerned about any “fuc”s or “sex”es which might arise, I developed the following one-line generator.
Generation of the initial string using crypt() and uniqueid() is perhaps not the best way in the world, but works fine for me. Just posting this here in case it helps anybody who does not necessarily want a whole function.
echo substr(ereg_replace(”([aeiou])[aeiou] “, “\\1″, ereg_replace(”([^aeiou])[^aeiou] “, “\\1″, ereg_replace(”[^[:alpha:]]”, “”, strtolower(crypt(uniqid()).crypt(uniqid()).crypt(uniqid()))))),0,8).”\n”;
Amazingly, this mess actually works great! You can change the “8″ at the end for different length passwords as required, and adding numbers could also be jigged onto this line of code.
Hello everybody, my name is Damion, and I’m glad to join your conmunity,
and wish to assit as far as possible.
Thanks, used this code for a project i’m working on.