The moose likes Java in General and the fly likes Password Generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Password Generation" Watch "Password Generation" New topic

Password Generation

Pol Appan
Ranch Hand

Joined: Aug 26, 2004
Posts: 144

I have a user information creation form in JSP. After the user succesfully creates his account an email will be send to him with a password.

What is the best way of generating an alphanumeric password?

Any help is highly appreciated.



Never take anything for granted because you never know when you will lose it
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780

There is no emoticon for what I am feeling!
Pol Appan
Ranch Hand

Joined: Aug 26, 2004
Posts: 144
Thanks a lot and much appreciated.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
A user-friendly technique is to find a large spelling dictionary somewhere on the web with thousands of words. Then pick two or three at random to make a password. I can still remember my CompuServe password from the early 80's: "WATER BOLDLY." I'd never remember QR1bA39u.

Still I have a routine to do just what was shown above. It accepts an argument with the valid characters, eg "BCDFGHJKLMPQRSTVWXYZ0123456789". Note I left out the vowels to avoid randomly generating some insult to the user's parentage though users from Qwhlgm are still at risk. You might also leave out 1 and 0 to avoid confusion with I and O.
[ September 23, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: Password Generation
It's not a secret anymore!