@virnuls/

Encryption with EOR

Python

Using EOR to encrypt text (in a similar manner to the WWII Lorenz machine)

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
plaintext = input("Enter the text: ")
key = -1
while key < 0 or key > 255:
  key = input("Enter a valid key: ")
  try:
    key = int(key)
  except:
    key = -1
ciphertext = ""
for char in plaintext:
  ciphertext = ciphertext + chr(ord(char) ^ key)
print("Cipher:",ciphertext)