Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For C++ Write a password checker that reads a series of passwords from a text file. Your program should check each password against a series

image text in transcribedimage text in transcribedimage text in transcribedFor C++

Write a password checker that reads a series of passwords from a text file. Your program should check each password against a series of rules and ensure that it does not appear in a list of common passwords. At the end of the program output a report to the console with how many passwords passed or failed. A good password must match all of the following conditions: - A length of 8 characters or more - At least one capital letter - At least one number - At least one punctuation character - Must not match a common password There are two input files: - testpass.txt contains 100 passwords to check, one per line. - 200 common.txt contains 200 common passwords, one per line. Use the first file as input into your password checking, and the second for determining if the password is a common one. If a password from 'testpass.txt' appears in '200common.txt', it should be rejected. Example Output Here is an example run. If your code is correctly checking passwords the good/bad count should match these numbers. Checked 100 passwords. Good: 10 Bad: 90 You will need some ways to inspect strings -- here are a few of their useful properties: - myString.size() returns the length of a string - A string can be accessed like an array. myString[0] is a 'char' representing the first character in myString - There are string "helper" functions such as isupper(), islower(), isdigit() that return true or false for a given character For looking up the password in the array of common passwords, use a linear search -- which starts at the beginning of the array and then steps through the elements sequentially until either the desired value is found or the end of the array is reached. For example, if the array is: \{"hello", "goodbye", "sometimes", "never" \} and we want to find the word "sometimes", the algorithm would check each element, starting with "hello", to see if it is equal to the search key, then proceed to the next one, all the way until the end of the array if needed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What type of advice and counsel do SCORE volunteers provide?

Answered: 1 week ago

Question

LO1 Identify why performance management is necessary.

Answered: 1 week ago