Question: Code in Python. Need to write the code to lookup a password. while True: print(What would you like to do:) print( 1. Open password file)

Code in Python. Need to write the code to lookup a password.

while True: print("What would you like to do:") print(" 1. Open password file") print(" 2. Lookup a password") print(" 3. Add a password") print(" 4. Save password file") print(" 5. Print the encrypted password list (for testing)") print(" 6. Quit program") print("Please enter a number (1-4)") choice = input() if(choice == '1'): #Load the password list from a file passwords = loadPasswordFile(passwordFileName) if(choice == '2'): #Lookup at password print("Which website do you want to lookup the password for?") for keyvalue in passwords: print(keyvalue[0]) passwordToLookup = input() ####### YOUR CODE HERE ###### #You will need to find the password that matches the website #You will then need to decrypt the password # #1. Create a loop that goes through each item in the password list # You can consult the reading on lists in Week 5 for ways to loop through a list # #2. Check if the name is found. To index a list of lists you use 2 square backet sets # So passwords[0][1] would mean for the first item in the list get it's 2nd item (remember, lists start at 0) # So this would be 'XqffoZeo' in the password list given what is predefined at the top of the page. # If you created a loop using the syntax described in step 1, then i is your 'iterator' in the list so you # will want to use i in your first set of brackets. # #3. If the name is found then decrypt it. Decrypting is that exact reverse operation from encrypting. Take a look at the # caesar cypher lecture as a reference. You do not need to write your own decryption function, you can reuse passwordEncrypt # # Write the above one step at a time. By this I mean, write step 1... but in your loop print out every item in the list # for testing purposes. Then write step 2, and print out the password but not decrypted. Then write step 3. This way # you can test easily along the way. # ####### YOUR CODE HERE ######

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!