Ok, so, there you are designing your web application and you've done the sensible thing, which is to simply pick up an off-the-shelf registration/user management system and plug it in right?
No, of course you didn't. Nobody I know does that. We all like reinventing that wheel too much.
Ok, that's a bit harsh. The truth is that user management isn't something that's just..fixed. A well designed application customises the security to the purpose and data.
A bank application really deserves decent passwords and 2-factor authentication (don't you dare get excited about the fact that I used that phrase). On the other hand, your michelin.com account tracking the size of your tires..well...if someone breaks in, all they're going to discover is that I don't own a car.
So the first thing you're going to do when thinking about your new app is deciding what level of security is really required. This influences a number of things:
1. Do you let users set their own passwords?
1a. What level of complexity do you require from user-provided passwords
2. How do you handle password resets?
3. Do you need password-authorised actions?
In this case I'm just going to talk about 1. People seem to swing back and forth on this one, from aggressively user-provided (User gives password on signup, reset lets them set new password) to mid (User might give password on signup, reset provides new auto-generated password), to aggressively not-user-provided (Signup generates password, reset provides new generated password, user cannot set password, only reset).
There are arguments for each approach, but in general unless you have specific security requirements you should think twice before taking control out of the users hands. The problem is that if the user can't use their usual junk password on your site, they're going to forget what it was. If your site isn't essential to them, they probably won't bother going through the reset process, so you'll be securely protecting a complete lack of interesting data.
What kind of situations would get you to reject user control? the simplest scenario is one where users spend a lot of time in a "compromised domain". That is, for example, an intranet web server where everyone uses the same username and password. If the users don't have any other sites they use, there is an excellent chance all of them will use the same shared password, leading to a miserable failure in isolating identities on the new service you're building for them.
If you find yourself having to do this, for gods sake remember that people need to be able to *remember* these passwords. 8is62jks0-_ is fantastically hard to brute-force or guess, but it's also stupidly hard to remember. Peoples minds do not take that kind of thing into storage well in general.
It's remarkably simple to generate passwords that are easy to remember. The most trivial system is this: follow every random consonant with a random vowel. Try it, pretty much every time you get something you can say to yourself in your head. The consontant-vowel formulation is easy to promounce (even when it's nonsense) and the rhythm makes it simple to remember.
There are downsides, the password becomes rather more predictable, but it has a couple of weird benefits as well.
In English, the consonant-vowel formula is associated strongly with baby talk. That is, despite it being so easy to remember, it is quite rare that you get a valid word out of it at any lengths beyond about 4 characters. Think of any swear word - almost none of them will ever be generated by this scheme.
A common source of confusion in passwords are the letters i and j, or 1 and l. Again this scheme completely dodges the bullet by virtue of context - if it's an even-numbered character it's going to be a vowel. The user knows this at a level below consciousness, they will automatically select the correct character most of the time (not that it's bad to remove these for safeties sake if you can handle the decrease in keyspace)
Finally, the pronounceable part means that it's easy to tell someone over the phone. While I highly recommend including phonetic representations of any passwords that are likely to be phoned out as a matter of courtesy, it still helps when someone is trying to tell someone on their cellphone from the supermarket.
It turns out that the numerical weakness isn't as scary as it would seem at first. It's not anything like as good as a truly random password of decent length, but remember that it is still random - and this makes it a significant step up on normal user passwords that are almost always derived from something.
If we decide to take "A-Za-z0-9_-+ ,." as a reasonably secure character space, with a minimum length of 6, we get a minimum keyspace of 98,867,482,624. That's a hell of a lot, especially since your secure application will start rejecting login attempts at 6 failures a day and you've salted all your stored passwords (right?). If you take a length of 8 for the scheme above, you get 121,550,625. That's 813 times more guessable than the best case, but it's pretty equivalent to the common space of 6 chars a-z (191mil).
What this means is that it's still perfectly secure against anything except the hash of the password being stolen, and quite frankly
you might be screwed if that happens regardless.
Bruce Schneier talks about password selection here. He indicates that with a standard guesser, 24% of user-provided passwords can be retrieved within 100,000 guesses. Even if the guesser was designed specifically for the algorithm above, there is no pattern that will enable that kind of thing. The first 100k guesses will only get a tiny fraction (0.08%) of the passwords in the db (if any). Conversely, the first 121,550,625 guesses will get every single password - you get a better baseline level of resistance at the cost of losing everything if someone is determined enough.
Assuming you're using a decently difficult hash algorithm and that you've salted it decently it's going to take almost anyone a pretty decent amount of time to get through that lot but in the end they probably can if they have your database and they want it enough. Assuming the value of the data is reasonably low however, your real concern is the vulnerability at the first N attempts, where N goes from 6 (casual attempt to break in) to 2200 (spends all year trying to get in via the website). In this case, the random babytalk method is considerably more secure than letting users select their own passwords (go go 'password1').
I guess I'm not particularly recommending this method, so much as saying that if you need to generate passwords, pay attention to making it memorable (so people don't sticky it to their monitor), and this is a simple way that isn't likely to be the weak link in the security chain.