Lookup Password for Websites Assignment

Added on - 18 Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 2 of 5 pages
Instructions:We will be extending the Caesar cypher we looked at earlier into a full-fledged password saver.The program will be able to:Lookup passwords for websitesAdd new passwords for websites (encrypting them with the caesar cypher)Store these passwords to a file on the computerLoad passwords from a stored password fileMost of the code is provided but there are some critical components missing. You will need toadd these components.A first draft is due at the end of Week 6. This is your opportunity to get feedback and support onthis assignment. I do not expect your first submission to work, you will receive credit for anysignificant attempt.The final version is due at the end of Week 7. Week 7 ends on a Friday, sodon't wait untilthe last minute!Create a python file called PasswordSaver.py in PyCharm and copy the following code into it.Extra Credit (max 5 points): Add additional menu items to the program. For instance, add theability to delete passwords.Provided code:importcsvimportsys#The password list - We start with it populated for testing purposespasswords=[["yahoo","XqffoZeo"],["google","CoIushujSetu"]]#The password file name to store the passwords topasswordFileName="samplePasswordFile"#The encryption key for the caesar cypherencryptionKey=16#Caesar Cypher EncryptiondefpasswordEncrypt(unencryptedMessage,key):#We will start with an empty string as our encryptedMessageencryptedMessage=''
#For each symbol in the unencryptedMessage we will add an encrypted symbol intothe encryptedMessageforsymbolinunencryptedMessage:ifsymbol.isalpha():num=ord(symbol)num+=keyifsymbol.isupper():ifnum > ord('Z'):num-=26elifnum < ord('A'):num+=26elifsymbol.islower():ifnum > ord('z'):num-=26elifnum < ord('a'):num+=26encryptedMessage+=chr(num)else:encryptedMessage+=symbolreturnencryptedMessagedefloadPasswordFile(fileName):withopen(fileName,newline='')ascsvfile:passwordreader=csv.reader(csvfile)passwordList=list(passwordreader)returnpasswordListdefsavePasswordFile(passwordList,fileName):withopen(fileName,'w+',newline='')ascsvfile:passwordwriter=csv.writer(csvfile)passwordwriter.writerows(passwordList)
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access