Oct-08-2019, 12:29 AM
So in our homework assignment, most of the code is given to us, and we have to write a few lines. Initially it asks for us to look at the passwords lists and print out a password based on the input, no problem, then it says to unencrypt the password using the Caesar Cypher, and tell us to go back to the lesson on it. The problem is it only tells us how to BUILD a Caesar Cypher, not how USE it in code. As it stands, I am trying to figure out how to use the already setup Caesar Cypher in my code so the passwords that print, are decrypted. I am not sure how much of the code I need to give, so I will start with the least possible, and go from there.
if passwordToLookup == 'yahoo': passwordEncrypt(print(passwords[0][1])) elif passwordToLookup == 'google': passwordEncrypt(print(passwords[1][1]))This is just the code I have written, I hope it has enough context, but I just am not sure how to implement the cypher into my code other than using the passwordEncrypt in it. In passwordEncrypt is (unencryptMessage, key), I just need to know how to implement the Caesar Cypher, no more.