Would like to create a strong password in C++. Any suggestions?
-
I assume it should use alpha (upper and lower), numeric, special characters.
-
It would be good to be able to specify a minimum length.
-
It would be great to avoid characters that are hard to visually distinguish like ‘O’ and ‘O’
-
It would be great to void all characters same, dictionary words, reversed words, names.
Any other tips? Where could I find code like this?
APG (Automated Password Generator) implements all but your last requirement (no dictionary words / usernames / repeated characters). It includes both pronounceable and fully random password generation algorithms. Pronounceable passwords look something like this:
It’s written in C and is available under a BSD-like license.
Cryptographically speaking, I’m not sure that your last requirement is valid…? If the password generation is truly random, then a password of
aaaaaaaais just as likely as a password of6-n&1jIK, and if your attacker knows your algorithm, then by disallowing passwords likeaaaaaaaa, you’re reducing the attacker’s search space.