A simple C program that evaluates the strength of a password based on various criteria.
This program analyzes a password and determines its strength based on the following factors:
- Presence of uppercase letters
- Presence of lowercase letters
- Presence of digits
- Presence of special characters
- Minimum length of 8 characters
- Real-time password strength evaluation
- Three strength levels: Weak, Medium, and Strong
- Simple command-line interface
- Character type detection (uppercase, lowercase, digits, special characters)
To compile the program, use any C compiler such as GCC:
gcc password_checker.c -o password_checkerRun the compiled program:
./password_checkerEnter your password when prompted. The program will analyze it and display the strength level.
Enter your password: MyP@ss123
Password Strength: Strong
The program calculates strength based on a scoring system (0-5 points):
- Weak (0-2 points): Password lacks multiple character types or is too short
- Medium (3-4 points): Password has good variety but may be missing some criteria
- Strong (5 points): Password meets all criteria including length and character variety
- 1 point: Contains uppercase letters
- 1 point: Contains lowercase letters
- 1 point: Contains digits
- 1 point: Contains special characters
- 1 point: Length is 8 or more characters
- The program uses
scanf("%s", password)which stops at whitespace, so passwords containing spaces cannot be fully tested - Maximum password length is limited to 99 characters
- No buffer overflow protection beyond the array size
- Doesn't check against common password lists or patterns
This is a basic educational tool for demonstrating password strength concepts. For production applications, use established password validation libraries and follow current security best practices.
- C compiler (GCC, Clang, or similar)
- Standard C library with
stdio.h,string.h, andctype.h
Free to use and modify for educational purposes.