Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Generating Passwords

843838Jun 16 2007 — edited Jan 15 2009
Aye,

I want to generate passwords automatically. In the user-add-script I wrote, the one who is adding the new users is not to pick the passwords due to several irrelevant reasons.
My script already works, using the timestamp as password, but 14849248294829 isn't really a user-friendly password. I'd rather have a randomly generated password existing out of 6 or 8 letters. I do have a plan in pseudo code, but I just can't figure out how to convert it into actually working JSP.

Here's what I want to do:

[pseudo]
String[] letters = a,b,c (...)
for (i=0, i<9, i++){
Randomly pick letters from the array.
}
String pass = above blabla.
[pseudo]

I guess that's a fair way of generating the passwords, but I haven't figured out how to actually program it properly.

Does someone have any idea?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2009
Added on Jun 16 2007
7 comments
126 views