我对我们的任务非常困惑:“开发程序的一部分,该程序生成程序用于加密消息的八个关键字符键”。我们正在尝试创建一个加密程序。该代码我到目前为止有:我现在需要做什么?
文件
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
我也很困惑。什么是“八键钥匙”?你可能是指“八个字符的键”(即八个字符的随机字符串)? –