A clean and beginner-friendly Java console application that validates password strength using
conditional logic and regular expressions.
π This project is designed for learning input validation, regex usage, and basic security rules.
β Password length validation (8β16 characters)
β Must contain at least:
- π‘ One lowercase letter
- π One uppercase letter
- π’ One digit
- π One special character (
! @ # $ % ^ & *)
β Displays clear and specific error messages for invalid passwords
- Java
- String.matches()
- Regular Expressions (Regex)
- Scanner (for user input)
- Compile the program : javac PasswordChecker.java
- Run the program : java PasswordChecker
- Enter a password when prompted.
| Rule | Requirement |
|---|---|
| Length | 8 to 16 characters |
| Lowercase | At least one aβz |
| Uppercase | At least one AβZ |
| Digit | At least one 0β9 |
| Special Character | At least one !@#$%^&* |
Strong password
Enter your Password: Abc@1234 Password was accepted and It is strong.
Weak password
Enter your Password: abc123 Doesn't contains UpperCase letter. Re-enter password. It is weak.
- Understand how password validation works
- Learn practical usage of
String.matches()in Java - Practice conditional logic and input handling
- Build a beginner-level security validation program
- Add retry mechanism until a valid password is entered
- Refactor logic into a single regex pattern
- Add GUI using Swing or JavaFX
- Add unit tests for validation logic
Puneeth Beginner Java & Cybersecurity Enthusiast
β Feel free to star the repository if you find it useful!