# coding: utf-8
from Crypto.Cipher import XOR
key = '123'
text = 'Привет мир!'
# Зашифровываем
cipher = XOR.new(key)
encrypted_text = cipher.encrypt(text)
# Расшифровываем
cipher = XOR.new(key)
decrypted_text = cipher.decrypt(encrypted_text)
print encrypted_text
print decrypted_text