Question

In: Computer Science

Privacy program, lab2pr2.py Write an automated password-hiding program that could be used in automatic password manager....

Privacy program, lab2pr2.py Write an automated password-hiding program that
could be used in automatic password manager. The program will first read user
passwords, one at a time, and store them in a list. When the user enters an empty
string (just hits enter), they are finished with the input. The program should
then replace each password with a string of * corresponding to the length of the

original password. As the output, the program should print the original list and
the resulting list.
For instance, here’s the output from a sample run of your program:
Please enter a password (press [enter] to finish): Tulane123
Please enter a password (press [enter] to finish): Bruff
Please enter a password (press [enter] to finish): LBCLBC
Please enter a password (press [enter] to finish):
[’Tulane123’, ’Bruff’, ’LBCLBC’]
[’*********’, ’*****’, ’******’]

use python

Solutions

Expert Solution

def mask(txt):

res=""

for x in txt:

res=res+"*"

return res

myList=[]

while(True):

#reading from user

word=input("Please enter a password (press [enter] to finish): ")

#if it is empty string than break loop

if(len(word)==0):

break

#appending to list

myList.append(word)

res=[]

#iterating the passwords

for x in myList:

#maskig and storing in another list

res.append(mask(x))

#printing list

print(myList)

print(res)

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me


Related Solutions

Suppose an automatic password cracking program takes an average of 10 minutes to crack one password...
Suppose an automatic password cracking program takes an average of 10 minutes to crack one password that has 10,000 possible combinations. (This means it would take 20 minutes if there were 20,000 possible passwords and 30 minutes if there were 30,000 possible passwords). a) 3 pts What is the maximum length of time the program would need to be able to crack a password of 8-character length made of only one number and seven lower-case letters? b) 6 pts What...
Write a C++ program that checks if the password is correct. The password is a 4-digit...
Write a C++ program that checks if the password is correct. The password is a 4-digit number combination. The program repeats to ask the password until the password is correct or you enter -1 to exit. Input: The password is set to ‘1123’. A user input the password to proceed, or -1 to exit. Sample Output: The program should display the following output. (The red text is a user input.) Test case 1: when you enter the correct password. Enter...
Using C++ Write a program to ask user to enter a password and validity the password....
Using C++ Write a program to ask user to enter a password and validity the password. The password should be 8 – 20 characters long (8 is included and 20 is included), it should contain at least one uppercase letter and one lower case letter. The password should contain at least one digit, and at least one symbol other than alphabets or numbers. Most importantly, the password may not contain any white space. Functions: You will need at least the...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are at least 40 lines of comments and 40 lines of code (1 point) b) the problem is described at the top of the program in a readable fashion (1 point) c) the code includes at least one instance of each of the five learning objectives listed above. (3 points) d) the code solves the problem. This may be assessed in part by a 'code...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are...
What to do: 1. Write a Python program, a1.py with the following characteristics: a) there are at least 40 lines of comments and 40 lines of code (1 point) b) the problem is described at the top of the program in a readable fashion (1 point) c) the code includes at least one instance of each of the five learning objectives listed above. (3 points) d) the code solves the problem. This may be assessed in part by a 'code...
Here is the problem I am working on. I need to write a py program that:...
Here is the problem I am working on. I need to write a py program that: Calculates a Cartesian Product Output, A x B of 2 lists. I want to limit each list to 5 numbers. It is kind of working, but I can't help think that there is a simpler way to express this problem. Please advise... Here is my code: def CartesianProductOutput(A,B):     lst = []     for x in A:         t = []         t.append(x)         for y in B:             temp...
How does a (properly configured and used) password manager improve the security posture of the user?...
How does a (properly configured and used) password manager improve the security posture of the user? What is the major “security bottleneck” associated with password managers, and what authentication mechanism is used to help alleviate this bottleneck? Describe the trade-offs between security and convenience with respect to local/offline password managers like KeePass and cloud-based password managers like LastPass?
1. Write a program that keeps asking the user for a password until they correctly name...
1. Write a program that keeps asking the user for a password until they correctly name it. Once they correctly enter the password, the program congratulates the user and tells them how many guesses it took. Be sure to be grammatically correct with the guess/guesses output. Call the program LastNamePassword. Example (user input in italics) What is the password? monkeys Incorrect. Guess again. dishwasher Incorrect. Guess again. aardvark Correct! You got the password, and it took you 3 guesses to...
2. Write a Java program to read a string (a password)from the user and then   check...
2. Write a Java program to read a string (a password)from the user and then   check that the password conforms to the corporate password policy.   The policy is:   1) the password must be at least 8 characters   2) the password must contain at least two upper case letters   3) the password must contain at least one digit   4) the password cannot begin with a digit   Use a for loop to step through the string.   Output “Password OK” if the password...
Write a program, Lab02_Q4.py, that inputs a string from the user, and creates a new string...
Write a program, Lab02_Q4.py, that inputs a string from the user, and creates a new string that deletes each non-alphanumeric character in the original string. You should solve this problem in 2 ways, first use a for loop that iterates through each character in the string, the second should use a while loop that iterates through a range. Keep spaces in the new string also. Hint: You can invoke the isalnum() function on a character, and it will return True...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT