This question already has an answer here:
- Java password generator 10 answers
I want a password generator in Java, which should generate passwords with standard criteria like at least 8 characters long,contains one upper case letter, one special character etc.
It will great if it is open source.
Any suggestions / pointers ?
Thanks.
If I where you, I would put all allowed characters in a
char[]
and useSecureRandom
to select n characters from this array.Once done, you could add digits and special characters until it fits your needs.