ó J(Zc@sQdZdZddlmZdd d„ƒYZd„ZdZedd ƒZd S( sđXOR toy cipher XOR is one the simplest stream ciphers. Encryption and decryption are performed by XOR-ing data with a keystream made by contatenating the key. Do not use it for real applications! :undocumented: __revision__, __package__ s$Id$i˙˙˙˙(t_XORt XORCiphercBs)eZdZd„Zd„Zd„ZRS(sXOR cipher objectcOs:tj|||Ž|_|jj|_|jj|_dS(sUInitialize a XOR cipher object See also `new()` at the module level.N(Rtnewt_ciphert block_sizetkey_size(tselftkeytargstkwargs((s3/tmp/pip-build-LvEk9W/pycrypto/Crypto/Cipher/XOR.pyt__init__(scCs|jj|ƒS(sńEncrypt a piece of data. :Parameters: plaintext : byte string The piece of data to encrypt. It can be of any size. :Return: the encrypted data (byte string, as long as the plaintext). (Rtencrypt(Rt plaintext((s3/tmp/pip-build-LvEk9W/pycrypto/Crypto/Cipher/XOR.pyR 0s cCs|jj|ƒS(sóDecrypt a piece of data. :Parameters: ciphertext : byte string The piece of data to decrypt. It can be of any size. :Return: the decrypted data (byte string, as long as the ciphertext). (Rtdecrypt(Rt ciphertext((s3/tmp/pip-build-LvEk9W/pycrypto/Crypto/Cipher/XOR.pyR ;s (t__name__t __module__t__doc__R R R (((s3/tmp/pip-build-LvEk9W/pycrypto/Crypto/Cipher/XOR.pyR%s  cOst|||ŽS(sŃCreate a new XOR cipher :Parameters: key : byte string The secret key to use in the symmetric cipher. Its length may vary from 1 to 32 bytes. :Return: an `XORCipher` object (R(RRR ((s3/tmp/pip-build-LvEk9W/pycrypto/Crypto/Cipher/XOR.pyRFs ii N(i!( Rt __revision__t Crypto.CipherRRRRtxrangeR(((s3/tmp/pip-build-LvEk9W/pycrypto/Crypto/Cipher/XOR.pyts !