だから私は暗号用のPythonプログラムを作成しようとしていて、(2つの異なる暗号を結合して)作成しました。プログラムを毎回開いたり閉じたりせずに、異なる文字列を簡単に暗号化できるようにしようとして立ち往生しています。64ビットのWindows7コンピューターでPython3.2を使用しています。
これが私のコードです(少し磨くためのヒントも教えてください):
#!/usr/bin/python
#from string import maketrans # Required to call maketrans function.
print ("Welcome to the Rotten Bat encription program. Coded in python by Diego Granada")
answer = input("Please enter the password: ")
if answer == 'raindrops':
print("Password accepted")
else:
print ("Incorrect password. Quiting")
from time import sleep
sleep(3)
exit()
intab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
outtab = "N9Q2T1VWXYZ7B3D5F8H4JK60n9pq2st1vwxyz7b3d5f8h4jk60"
message = input("Put your message here: ")
print(message.translate(dict((ord(x), y) for (x, y) in zip(intab, outtab))))
print ("Thank you for using this program")
input()