我對我們的任務非常困惑:「開發程序的一部分,該程序生成程序用於加密消息的八個關鍵字符鍵」。我們正在嘗試創建一個加密程序。該代碼我到目前爲止有:我現在需要做什麼?
文件
def fileopen():
filename=input('What is the name of the file: ')
with open(filename) as yarr:
contents=yarr.read()
return contents
菜單
print ("Hello, welcome to the encryption/decryption program")
print ("1 - Encryption")
print ("2 - Decryption")
print ("3 - Exit")
choice=input ("Enter a Number")
while True:
if choice=="1":
print("Encryption Selected")
filecontents=fileopen()
print(filecontents)
break
elif choice=="2":
print("Decryption Selected")
break
elif choice=="3":
print("Thank you, come again")
break
else:
choice=input("Incorrect number")
continue
我也很困惑。什麼是「八鍵鑰匙」?你可能是指「八個字符的鍵」(即八個字符的隨機字符串)? –