维吉尼亚密码
程序员文章站
2022-07-08 20:34:40
...
维吉尼亚密码
str1="askflsd海绵宝jfodfijslkjfof"
str2="aklsdjf派大星owijfskdfjosif"
str3="skdlfsd章鱼哥fkjsdlfkjsldkf"
str4="skjdflk蟹老板sdjflskddfjoss"
table1=str.maketrans(str1,str2)
table2=str.maketrans(str3,str4)
one=input("输入加密内容:")
ge=one.translate(table1)
ge1=ge.translate(table2)
print("密文:%s" %ge)
two=input("输入解密内容:")
#print("she is a good gril")
print("海绵宝")
实验结果:
D:\python\python.exe C:/Users/ASUS/PycharmProjects/untitled1/test/wangye.py
输入加密内容:dsfdf
密文:jdfjf
输入解密内容:jdfjf
海绵宝
Process finished with exit code 0