Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Imagine that you are a system administrator developing a password-based authenti

ID: 3700834 • Letter: I

Question

Imagine that you are a system administrator developing a password-based authentication system that can allow users to choose passwords of exactly length len from 20 unique characters. Suppose there is an attacker who wants to guess the password of a user by launching a brute-force attack using a machine that can verify 1000 possible guesses per second. As a system administrator, you want to make sure that an attacker cannot successfully guess a password for a period of 6 months (assuming that users change pass- words for every six months). Based on the above input values, please write a program to find out the length of the password (i.e., the value of len) in order to achieve your goal?

Please help me, the code must be in JAVA to find the length of the password.

Explanation / Answer

Answer:

PROGRAM:

#include <bits/stdc++.h>

using namespace std;

void printStrong(string& input)

{

int z = input.length();

bool hasLower = false, hasUpper = false; // checking lower alphabet in string

bool hasDigit = false, specialChar = false;

string normalValue = "abcdefghijklmnopqrstuvwxyzA1234567890!@#$%^&*";

for (int x = 0; x<z; x++){

if (islower(input[x]))

hasLower = true;

if (isupper(input[x]))

hasUpper = true;

if(isdigit(input[x]))

hasDigit = true;

size_t special = input.find_first_not_of(normalValue);

if(special != string:: npos)

specialChar = true;

}

cout<< "Strength of password:-"; // Strength of password

if (hasLower && hasUpper && hasDigit && specialChar && (z>=8))

cout<< "Strong" << endl;

else if ((hasLower || hasUpper) && specialChar && (z>=6))

cout<<"Moderate" <<endl;

else

cout<<"weak" << endl;

}

int main()

{

string input = "ManIsMan!@1714";

printStrong(input);

return 0;

}