It's not a secret anymore!
The moose likes Beginning Java and the fly likes Re: password policy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Re: password policy" Watch "Re: password policy" New topic

Re: password policy

Joe Cheung
Ranch Hand

Joined: Oct 18, 2002
Posts: 104
Dear all,

How can I implement my own password policy that the password must consists of at least one character (a-z or A-Z) and one numeric value (0-9) in Java?


Tom Tremain

Joined: May 09, 2005
Posts: 1
A good place to start would be to read the javadocs for the the isDigit(char ch) and isLetter(char ch) static methods of the java.lang.Character class.

Using these methods inside of a loop should enable you to verify that a password meets the security requirements defined in your post.
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
Yosi Hendarsjah
Ranch Hand

Joined: Oct 02, 2003
Posts: 166
You can use regular expression.
I agree. Here's the link:
subject: Re: password policy
It's not a secret anymore!