by jsprogrammer · 10y ago · 0 comments
$ dd if=/dev/random bs=1 count=32 | base64
ca2ktYYvppr1/HwwGYrg01udQX1cP4Ek5VmyzQydT+8=... when I just still wet behind the ears I was studying the codebase of my first job, and came across a quite extensive badwords.txt . On asking why we had a the dictionary of cussing in our project, I found out that the randomly generated passwords that we sent to our clients, apparently managed to get a customer quite angry when one of the words produced started with a slur, and this was a filter to prevent that from happening again
Generating random passwords isn't quite as straightforward as it would seem to be...
> we sent to our clients
I'm making the assumption that these are one-time passwords for initial account setup. But no, no one scheme will work for everything, obviously. The hex version will fail for schemes which have an upper limit, or when there's a requirement for upper/lower/symbols. The base64 encoding will fail other validations due to the '/' character, or for particularly restrictive upper size limits.
I wish all of them would simply accept a string and put in an upper limit of 1k to limit DOS by password. Call it good.
Isn't it easier to just generate words without vowels? This is the more common solution to that problem, IIRC.
Case in point: Not all scripts even have vowels.