[ create a new paste ] login | about

Link: http://codepad.org/usp8gCoF    [ raw code | output | fork ]

Python, pasted on Feb 15:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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


Output:
1
2
���������
Привет мир!


Create a new paste based on this one


Comments: