Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Taking in mind that being a a deterministic machine a today computer is incapable of producing random sequences and all computer-generated "random" sequences are pseudo-random actually, aren't computer-generated random passwords insecure? Isn't it more secure to just press keys randomly to create a random password than to use a digital generation algorithm?

share|improve this question
As you've not qualified the question with an algorithm and there are innumerable algorithms for generating passwords this question simply makes no sense. Further, it is a programming issue, not system administration. – John Gardeniers Jul 9 '10 at 1:41

Humans typically do a very poor job at generating randomness. It is possible to get truly random numbers for computer generating passwords. One way would be to setup your computer to seed itself from which generates numbers by monitoring atmospheric noise. A computer mostly like does as good or a better job then the typical person who probably doesn't care too much about how much randomness their password has.

These days passwords are really not that useful anyway. If you do a search you can fine several security professionals arguing that people are going overboard on their expectations about passwords. I think you'll find that it is becoming far more common for passwords to be acquired by phishing, keyboard loggers, and other types of attacks where the password length and level of randomness is completely irrelevant.

Any well designed system will prevent an intruder from running any kind of dictionary attack remotely by using lockouts and rate-limiting authentication attempts. The secret hashes will be pretty well protected against interception.

Of course this like all things security related depends on the amount of risk. For a low value system with reasonable safe-guards computer generated passwords are almost certainly fine. If you are responsible for security of the codes for the nuclear weapons you probably will want to spend a bit more effort on coming up with good passwords.

Are computer-generated passwords secure?

I am sorry, but secure never has and probably never will be binary. Nothing will every be in a state of 100% secure or not. Correctly generated passwords in many cases will be far more secure then the alternatives.

share|improve this answer
"setup your computer to seed itself from which generates numbers by monitoring atmospheric noise": it's an excellent idea. In the same way, a computer may use webcam to calculate some random stuff from a capture, or use temperature sensor or a microphone to seed, or calculate time in ms. elapsed since the last reboot. – MainMa Jul 8 '10 at 23:57
I recommend trusting the people who have coded the entropy generator for your computer. When you start making up your own methods, or worse, getting it from someone else, you are running full-tilt towards exposing the very thing you're using randomness to protect. – Slartibartfast Jul 11 '10 at 3:03

Your argument has a couple of premises:

Given: Good passwords are completely random
Given: Passwords generated by a deterministic machine are not random

IF deterministic THEN not random
IF not random THEN not good

Therefore: Generated passwords are not good. QED.

Your premise that good passwords are completely random is incorrect. Experience has shown that good passwords have a number of traits. Good passwords have to resist certain kinds of attacks, only one of which is password guessing. 50+ years of experience with passwords has shown that good passwords have a number of traits:

  • Long enough to make randomized guessing take too long.
  • Have enough entropy to make each character significantly non-dependent on other characters in the password.
  • Are able to be memorized.

The (welcome) death of the 8-character limit on passwords has opened up a whole new universe of good password possibilities. It has also divided what counts as a good password.

A good password on Solaris: 1ŤŁÃb$R=
A good password on Windows: 0123456789abcefBubba2pAantz

The first has very high entropy out to eight characters. The second has laughable entropy out to 16 characters, but passable entropy after that. The second would be an insane password for Solaris since it would be truncated after the 8th character, where the first would be lamentable on Windows if that password hash ever got discovered (sniffed in flight, sucked down from a domain controller, that kind of thing) thanks to Rainbow Tables. (I had a blog post about this a while back that goes into more detail about this issue in the context of cross-platform password policies. Link)

Therefore a good password has high entropy AND length. When you can't use length (that 8 character limit again) you're stuck with high entropy. When you have very large length (512 characters!) the password can include significantly less entropy for the same attack resistance.

To whit, good passwords can be completely random. Not must be.

As for your second point, about a deterministic machine's inability to produce random output. A deterministic machine using a random input can produce output containing zero to the amount of entropy it got as input, but not introduce any new entropy. In this way a password generator using 2 bytes of entropy from /dev/random (not /dev/urandom) can produce a 40-character password of high apparent randomness. Of course, if those two bytes and the algorithm used to generate passwords are known to the attacker the actual password can be derived.

The algorithm is easier to find out than the actual random bytes used to seed the algorithm. They're well published, since high quality pseudo-randomness is a valuable thing for everyone. That means that attackers have to try (in this case) every possible 2-byte combination for every permissible length. (See also: Rainbow Tables)

To whit, Passwords generated by a deterministic machine can have high randomness.

And finally, what makes machine-generated passwords bad is not their ability to be derived post-facto, it is that third bullet point I made about what makes a good password: able to be memorized. Machine-generated passwords, especially long ones, can be VERY hard to memorize which will in turn lead to them being written down somewhere insecure. Or quickly changed to something else with less length/entropy strength.

share|improve this answer
Note: I know Solaris can support passwords over 8 now. However, it came late to the game. We have some Sol boxes that still have the 8-char limit. – sysadmin1138 Jul 11 '10 at 6:10

Isn't it more secure to just press keys randomly to create a random password than to use a digital generation algorithm?


For a given length of password, one that is generated randomly from the full possible symbol set will be significantly more secure than just pressing keys randomly.

share|improve this answer

Isn't it more secure to just press keys randomly to create a random password than to use a digital generation algorithm?

In practice, it could be, although while pressing keys randomly the chances of you holding shift to make some symbols is unlikely :)

For pseudo-random passwords, it all depends on how you're generating them. There is a myriad of sources you can use as input into an algorithm, and many algorithms to utilize. The things that would make a long, randomly-generated password weak is disclosing:

  • The data used as a seed for the algorithm
  • The algorithm itself

essentially it is a 2-piece puzzle that just takes a while to complete. If they have the details it's just a matter of time before it's cracked. Speaking of time, it's one of the most common seeds used in pseudo-random generation.

If there's one tip I can give you to keep a secure password, computer generated or not, it would be to use a very long password which will take a long time to crack. Also, don't use any tools online to generate passwords. In 1 simple line of code, the people hosting the generator can insert the generated passwords into a database.

share|improve this answer
while those services could be storing every password in a database, they don't know what you're using it for, or if you've only adopted parts, etc – warren Aug 30 '11 at 18:56

You said it, it depends on how "random" the passwords are.

A computer-generated password program that looks like this:

string generatePassword(){
    return "asdf";

isn't going to be very good.

The downside of "pressing randomly" is that your ratio of "special" characters (!@#$%^<> etc) is going to be low, as you're unlikely to be pressing the shift key at the same time you strike `-0 or any of the other non-alpha keys.

share|improve this answer
"your ratio of "special" characters is going to be low": or too high. I noticed that when forced to type something random (for example a question or an answer on a website which will be used to recover a password), most of the times I have something like "hè9b7#<U&B+1@" (french keyboard layout), with a very low ratio of small letters. – MainMa Jul 9 '10 at 0:15
True, non-US layout keyboards may vary the output. – Mark Henderson Jul 9 '10 at 2:26

I will pay you 200 US$ for cracking my 25 symbols password 22 to 25 symbols password (the length being also random) I use on ServerFault.

Now, seriously, a hacker might probably find a randomly generated password if:

  • She has a huge knowledge in computer security and algorithms used to generate random numbers,
  • She knows exactly what application used a target to randomly generate a password,
  • She can find when the password was generated (up to μs.)
  • She's lucky.

So I have some doubts that every hacker can do it.

Now, the most obvious way used to crack passwords is brute force.

If a target typed her password "randomly" on his keyboard, then the password has strong chances to match a pattern: for example, if the first letter the person typed is on the left side of a keyboard, the second one will probably be on the right side or be a number or a symbol.

It would be interesting to test it asking people to type a "random" thing using only four digits. My expectation is that, first, the typed numbers will not be random at all, and that some will be much more frequent than other ones (for example, if we are asked to type something "random", we will never type "1234" or "7458" or "3197" or "5555").

Since both machine-generated and human-typed passwords leak some randomness, IMHO the best thing would be to combine both. For example, the password will be generated from a user input, or combined with it. By the way, some sort of such implementation is a salt (for example where a password of a user submitted on a website is combined to a randomly generated set of symbols before calculating and storing a hash: in this case, if two users have the same password, the hash will still be different).

share|improve this answer
erm? Serverfault doesn't have a password system. It uses openid from somewhere else. Care to tell us your openid provider to save us a step? – Zoredache Jul 8 '10 at 23:49
Never met a female that wanted to crack a password? :P – RHELAdmin Jul 8 '10 at 23:52
The most obvious way used to crack passwords is brute force. -- This may be the most obvious way, but also not very effective against well setup systems that will prevent brute force attacks. – Zoredache Jul 8 '10 at 23:54
@RHEL, I had an ex-girlfriend who spent about 10 hours after we broke up attempting to get into my email account. Unfortunately the only reason she gave up after 10 hours because she finally succeeded at guessing my "random" password. So yes, I have ;) – Mark Henderson Jul 8 '10 at 23:56
@Zoredache: I was talking about my OpenID password. ;) Well, "a password I use to connect to ServerFault". Even if it's through OpenID system. "not very effective against well setup systems": I would say nothing is effective enough against well setup systems. – MainMa Jul 9 '10 at 0:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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