# Program to encrypt using Caesar cipher # Matt Bishop, Apr. 17, 2009 # for ECS 10 Spring 2009 # # this corresponds to a key of 'D' ('A' = 0, ... 'Z' = 25) key = 3; # # ask user for input message (plaintext) # plain = raw_input("Enter your message here:"); # # initialize output (ciphertext) # cipher = ""; # # encipher each character and append it to current ciphertext # for i in plain: # shift it by key amount c = (ord(i) + key) % 256; cipher = cipher + chr(c); # # print it, surrounded by quotes # print "\"%s\"" % cipher;