I was hoping someone could recommend a good password generator.

Extra props to the person who can name one that gives you a mnemonic to remember it as well.

  • 7
    You could always just 'echo "random" | md5sum' :) Feb 7, 2011 at 0:41
  • 8
    @GeorgeEdison Why stop at md5? echo 'keyword' | sha1sum Feb 7, 2011 at 14:12
  • @George @Marco haha nice trick.
    – myusuf3
    Feb 7, 2011 at 16:19
  • 3
    dd if=/dev/random bs=32 count=1 2> /dev/null | md5sum | cut -b 10-20 Should give you about 40 bit entropy/security. Feb 16, 2015 at 22:28

17 Answers 17


pwgen Install pwgen generates random, meaningless but pronounceable passwords. These passwords contain either only lowercase letters, or upper and lower case mixed, or digits thrown in. Uppercase letters and digits are placed in a way that eases remembering their position when memorizing only the word. .

Install pwgen with the button below:

Install via the software center


sudo apt-get install pwgen
  • pwgen is also available for cygwin
    – jan
    Oct 31, 2014 at 10:31

apg Install apg

APG is the Advanced Password Generator. The software is used to automatically generate new passwords for whatever use you feel like putting it to.

Here are some key features of "APG":

  • Setting maximum percentage of special characters
  • Setting the length of generated passwords
  • Grouping characters
  • Setting a number of passwords to generate
  • Setting a random seed file
  • One Time Pad Generation
  • Printing how many passwords it generated in how many second

To install, run this command:

sudo apt-get install apg

Install and using Apg with this help guide

  • 2
    Both the author's page for apg and the Ubuntu page you link to refer to it as "Automated" rather than "Advanced". Several of the bulleted points in this answer don't seem to be currently supported (if they once were), notably percentage of special characters, a seed file, One Time Pad, generation rate. Aug 13, 2015 at 21:01

Aberystwyth University has a pretty hardcore mnenomic-passsword generator.


Generates evil password like this:

<1n255s4    Lisa's first newt zooms Fife's fifth shrewd four.
t6pnjsnv    Tony's sixth padlock nags John's spectacular number vainly.
fqyumdc8    Fiona's quadrilateral yucca understands Murray's dormant calculating eight.
ee6pk3cm    Eve's egocentric six ponders Ken's third cagey magazine.
q1giwn?n    Quentin's first galaxy improves Wyn's nondescript question mark nastily.

Interesting work. You might like to email their sysops to see if the script behind it is freely available (and if it's not, whether they'd consider GPLing it)

Edit: Looking at the output a little more cafefully, this would not be hard to code. You'd just need several dictionaries to feed it.

  • 24
    Seems like you'd need a mnemonic to remember the mnemonic.
    – belacqua
    Feb 7, 2011 at 6:53
  • but how can one have a < in the password? in an international setting were you have different keyboards I would not recommend this.
    – Marcel
    Feb 9, 2011 at 7:49
  • 2
    I haven't looked at this generator, but I hope it lets you generate passwords longer than 8 chars. 8, even with special chars, is well within the realms of instantaneous rainbow table pwnage, if the hash is ever grabbed (and this happens a lot!)
    – Rory Alsop
    Jun 29, 2011 at 8:59
  • The funny part is that if you can remember that mnemonic, you could have used it as a password from the start. Passwords should be easily memorizable, but hard to break. These passwords are flawed both ways. Jul 1, 2016 at 12:53

Try the password card. You carry it in your wallet and you remember two symbols and a color.

You read the letters / numbers between the symbols along a color line, or make up any algorithm that you can remember.

The site generates a random card for you.

Password card



The results are more hideous even than apg or pwgen (even with the -s option set), but this is more fun:

head -c 8192 /dev/urandom  |   strings --bytes 8 | sed 's/\s//'

I suspect your use case if different, but this kind of thing is useful for shared secret keys, and other kinds of passwords that you don't type in very often.
To get a larger selection, pass more bytes to head, and to get longer password result strings, modify --bytes in strings (which gives a minimum length). the sed expression strips out strips out spaces and tabs (represented by \s).

However, you will at some point probably appreciate applications (like pwgen, KeePassX or LastPass) that give you an option to avoid easily confusable characters, like 1 and l and I . These can look like 1Il or 1Il or worse. You would want to use an option like this if you are resetting someone's password or giving a one-time passkey that needs to be communicated.

Stil, pwgen put gives this caveat in its man page, describing its -B option:

   -B, --ambiguous
          Don't use characters that could be confused  by  the  user  when
          printed,  such  as 'l' and '1', or '0' or 'O'.  This reduces the
          number of possible passwords significantly, and as such  reduces
          the  quality  of  the passwords.  It may be useful for users who
          have bad vision, but in general use of this option is not recom‐

This is nuts, of course. You probably know when this is useful or not. And it's certainly better than using 'Pa$$w0rD' for everything. If in doubt, create a longer password, or pass your generated password as input to another generator, or use multi-factor authentication.


No mnemonics, but pwgen is pretty straightforward.


I use mkpasswd. While technically it is used to encrypt a password for use inside an /etc/passwd file, it also gives nice strings of characters suitable for passwords.

  • Can you reference a source about how suitable this is for password generation? Jul 24, 2015 at 17:07
  • 1
    It's 25 rounds of 56 bit DES, with a small modification. I doubt there is an algorithm that can enumerate the generated bit patterns without introducing duplicates, so knowledge of the algorithm used would not give an advantage to an attacker, except that the length is known in advance. Jul 24, 2015 at 19:41
  • 2
    I doubt however that this has been actually explored by cryptanalysts. The search space obviously depends on the random data that went into the algorithm -- if it is known that all you do is mash the keyboard, that is a smaller space than actually using 56+12 bits from a good RNG. Jul 24, 2015 at 19:45

I use apg -- sudo apt-get install apg


Keypass has a built in password generator. Generate your new password and remember it with the same tool.

  • 3
    And they're properly evil. Like, 32 character randomly generated evil. You'd need keepass to remember the passwords it generates. :-)
    – Scaine
    Feb 8, 2011 at 0:38

SuperGenPass is a bookmarklet solution originally intended for website logins, but it can easily be used for applications, too. It uses a master password plus the current domain name (or application name, if you like) to generate 10-character passwords like lCY9gjiDtF. It doesn't need mnemonics because it can one-click auto-fill the password box, and allows copy/paste into other applications too.

I keep a bookmarklet in each of my browsers, and on my cell phone (works offline, too!). It's very convenient. If you're "brave" then you could even hardcode the master password into the bookmarklet.


I got some pretty good feedback with brain-generated passphrases.

Password please :
¡I don't use p4sswords with known fixed p4tternS!

Alas it's not a free generator, because it works better with a cup of coffee, nor is it open-source (but kinda difficult to hack).


I use FPM2 (figaro) password manager. No mnemonics, but you have a password generator, and you just have to keep in mind one password. Simply search it in Software Center.

Or, if you like a "low-tech" but ingenious solution, you can watch at this: http://www.passwordcard.org/en


Here's a JavaScript bookmarklet. It will ask for the length and then create the password. Just create a new bookmark with the following address:

javascript:(function(){var d=prompt("Password length","14");if(d){for(var e="",a=Math.random,b=Math.floor,f=0;f<d;f++)x=62*a(),x<=10&&(c=48+b(10*a())),x>10&&x<36&&(c=65+b(26*a())),x>=36&&(c=97+b(26*a())),e+=String.fromCharCode(c);prompt("Password",e)}})()

For those interested, the above bookmarklet was using the below code, minified with Closure Compiler:

(function () {
    var n = prompt("Password length", '14');
    if (n) {
        var s = "",
            r = Math.random,
            f = Math.floor;
        for (var i = 0; i < n; i++) {
            x = 62 * r();
            if (x <= 10) c = 48 + f(10 * r());
            if ((x > 10) && (x < 36)) c = 65 + f(26 * r());
            if (x >= 36) c = 97 + f(26 * r());
            s += String.fromCharCode(c);
        prompt("Password", s);
  • Your old code was leaking the password to the webpage. This function makes it a bit more secure (providing that the webpage does not overwrite the used functions to capture the arguments ;))
    – Lekensteyn
    May 27, 2011 at 19:58

I found a good website with a few interesting options for password generation, strength testers etc. It is prints the password out as mnemonic.

It isn't flawed terribly like some of the major websites that people are currently using for password generation and testing.



http://www.random-password.co.uk is a free online generator?

  • 2
    And when you generate the password this way, it's transmitted over the plaintext HTTP connection, so this can be sniffed easily and is not secure. That's without mentioning that owner of the service can log generated passwords in this kind of service. Oct 10, 2016 at 10:10

Has Revelation been considered? Not only will it generate the password, it will assist in keeping track of them.


Mozilla has a little Flash video on a password schema you might enjoy at http://www.labnol.org/internet/different-passwords-for-websites/17961/

Not the answer you're looking for? Browse other questions tagged or ask your own question.