Answer the question
In order to leave comments, you need to log in
How to implement XOR encryption?
Hello.
I'm trying to write a small program for XOR encryption.
There were problems with the implementation, due to lack of knowledge.
It is necessary to implement the input of a message and a key from the keyboard.
Encrypt and output the cipher.
Decrypt and output.
Now I'm trying to translate each letter separately in the message
for letter in message:
print bin(ord(letter))[2:]
while список.__len__() < 8:
список.insert(0, '0')
Answer the question
In order to leave comments, you need to log in
This type of encryption is in pycrypto
from Crypto.Cipher import XOR
key = '123'
cipher = XOR.new(key)
text = 'plaintext'
cipher.encrypt(text)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question