September 20th, 2002, 04:52 AM
A random password generator
You may already have your own practical way of choosing good password manually. But you may also wonder how some sites can give you an initial random password when you sign up. I know, google can give me a bunch of links for password generator program, but I'm curious on how to do it. So I've been thinking about generating random password programatically, and here's what I came up with.
Originally posted here by ashbourn
the best passwords are random ones.
Have a look at the sample HTML page (I also attach it below).
All passwords generated by this program should contain
- mixed case, all uppercase, or all lowercase letters
- at least two numbers or special characters
- a letter in the first and last position
It does include user-selectable special characters like ~!@#$%^&*_. Note that some security experts discourage it as (1) people find them hard to remember, (2) it may break many things (someone set his CMVC password to 'abc|def', then received an error saying "Unable to execute def!"), also (3) it could be a problem if you switch among different national keyboards. Personally, I think it's good to have carefully-selected special characters in a password.
The program is totally free for anybody to use, modify, or distribute, as a whole or partially, without any warranty or support. I added some comments for learning purposes (who says programming ain't fun?). Ummm... oh, any comments are welcome!
Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds
September 20th, 2002, 06:50 PM
It's going to be a cooperative effort, depending on how it is seeded.
Edit: Don't quote me, I'm only partially sure about this.
Living life one line of error free code at a time.