-
-
Notifications
You must be signed in to change notification settings - Fork 80
Added Password Strength Checker (C++) for Better Security Awareness #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added a C++ program that checks password strength based on standard security guidelines. This code helps users understand secure password practices β enhancing the projectβs security awareness and practical coding examples.
β¦patch-1 Create SECURITY1.md
WalkthroughA new C++-like password strength checker demonstration is added to SECURITY1.md, implementing an Changes
Sequence DiagramsequenceDiagram
participant User
participant Program
participant isStrongPassword
User->>Program: Enters password
Program->>isStrongPassword: Calls with password string
activate isStrongPassword
isStrongPassword->>isStrongPassword: Check length β₯ 8
isStrongPassword->>isStrongPassword: Check for uppercase
isStrongPassword->>isStrongPassword: Check for lowercase
isStrongPassword->>isStrongPassword: Check for digit
isStrongPassword->>isStrongPassword: Check for special char
isStrongPassword-->>Program: Returns bool result
deactivate isStrongPassword
alt Password Strong
Program->>User: Print success message β
else Password Weak
Program->>User: Print warning message β οΈ
end
Program->>Program: Exit with code 0
Estimated code review effortπ― 2 (Simple) | β±οΈ ~12 minutes
Poem
Pre-merge checks and finishing touchesβ Failed checks (2 warnings)
β Passed checks (1 passed)
β¨ Finishing touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
π§Ή Nitpick comments (2)
SECURITY1.md (2)
7-20: Clarify special character validation logic.Line 16's
else hasSpecial = true;is overly broadβit treats any non-alphanumeric character (including whitespace, punctuation, symbols) as "special." For a security-focused password checker, consider being more explicit about what constitutes a valid special character (e.g.,!@#$%^&*). If this intentionally accepts any non-alphanumeric character for educational simplicity, add a clarifying comment.
22-34: Address input handling limitation:cin >> passwordonly reads single-word passwords.Line 25 uses
cin >> password, which stops at the first whitespace. This means passwords with spaces (e.g., "MyPass word123!") will only capture "MyPass," silently truncating the user input. For an educational example on security awareness, either:
- Add a comment explaining this limitation, or
- Use
getline(cin, password)to accept full-line input (handle newlines in the input buffer accordingly).Additionally, consider adding basic error handling after the
cinoperation to gracefully handle input failures.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
SECURITY1.md(1 hunks)
π§° Additional context used
πͺ markdownlint-cli2 (0.18.1)
SECURITY1.md
1-1: No space after hash on atx style heading
(MD018, no-missing-space-atx)
2-2: No space after hash on atx style heading
(MD018, no-missing-space-atx)
3-3: No space after hash on atx style heading
(MD018, no-missing-space-atx)
|
@japinderofficial-hub this is not required |
π Pre-submission Checklist
#pull-requestchannel to ensure no one else is working on this issue#pull-requestchannelSummary
Brief description of what this PR accomplishes.
Type of Changes
Testing Completed
Development Setup Verification
Code Quality
Related Issues
Closes #
Screenshots/Videos
Additional Notes
Any additional information or context about the changes.
Note: For faster PR review and approval, ensure you're active in our Discord server!
Summary by CodeRabbit