Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def encryption(m,k):
- ret = ""
- for i in range(len(m)):
- ret += chr(ord(m[i])^ord(k[i%(len(m)-1)]))
- return ret
- if __name__ == "__main__":
- print("Let's try the program!")
- m = input("Write the message to process: ")
- k = input("Write the key here: ")
- if len(k)<len(m):
- k = k*len(m)
- print("Your cyphertext is: \n %s" %encryption(m,k))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement