Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Generate random passwords via a perl script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Generate random passwords via a perl script
Authored by: merlyn on Mar 02, '06 07:13:01AM
Or, without installing anything, you can use the standard "openssl" command to generate crypto-strong passwords.

openssl rand -base64 6
will generate an 8-character string from the base64 charset (upper/lower letters, digits, and slash and plus). For longer strings, just use a multiple of 3 for every 4 characters you want in the output.

[ Reply to This | # ]
Generate random passwords via a perl script
Authored by: badger brigade on Mar 02, '06 08:40:05AM

Is there a way to make it only use alphanumeric characters (ie not slash or plus), apart from piping it through sed?



[ Reply to This | # ]
Generate random passwords via a perl script
Authored by: fungus on Mar 02, '06 10:30:47AM

Why? Your password should be stronger than just alphanumeric.



[ Reply to This | # ]
Generate random passwords via a perl script
Authored by: stholland on Mar 02, '06 11:53:23AM

Unfortunately there are many Web sites out there that restrict passwords to alphanumeric characters only. Sometimes one can not avoid using them.

---
/
\
/



[ Reply to This | # ]
Generate random passwords via a perl script
Authored by: fungus on Mar 02, '06 02:16:56PM

Ok, good point.
Then in that case I might suggest using APG
http://www.adel.nursat.kz/apg/
"fink install apg"

It is highly configurable to output really good passwords with any charset you want. It can also try to make them pronouncable.

Also after you do this, send an email to that particular website's webmaster and complain about the problem with the password's limitations. These limitations should be unnaceptable.



[ Reply to This | # ]
Generate random passwords via a perl script
Authored by: victory on Mar 02, '06 07:19:27PM

Here's what I currently use (fiddle with the pipe-filtering to suit your own needs):

openssl rand -base64 1000 | tr "[:upper:]" "[:lower:]" | tr -cd "[:alnum:]" | tr -d "lo" | cut -c 1-32 | pbcopy

Generates a 32-character, alphanumeric, all lowercase password excluding the letters L (el) and O (oh) and copies it to the clipboard. Granted this only yields 5-bits of entropy per character, but in my case I exclude L and O (which resembles 1 and 0) so as to reduce user confusion.

Yeah, this is still somewhat of a kluge as there is an *extremely small* ( (6/64)^968, I think) probability that it will fail to yield the requested 32-characters.



[ Reply to This | # ]
Generate random passwords via a perl script
Authored by: badger brigade on Mar 04, '06 12:02:59AM

Nice one (I can live with those odds of failure).



[ Reply to This | # ]
Generate random passwords via a perl script
Authored by: Elander on Mar 04, '06 04:59:27AM

I personally favor Make-A-Pass, a Dashboard widget that can create passwords in a number of formats, including FIPS 181.

You can find it here:
http://andrew.hedges.name/widgets/

I am not affiliated with the author, don't even know him, but I like the widget.

---

/elander



[ Reply to This | # ]