Current File : //usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyc
�
�/�Oc@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((s7/usr/lib64/python2.7/site-packages/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((s7/usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyR0s	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((s7/usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyR
;s	(t__name__t
__module__t__doc__R
RR
(((s7/usr/lib64/python2.7/site-packages/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	((s7/usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyRFs
ii N(i!(	Rt__revision__t
Crypto.CipherRRRRtxrangeR(((s7/usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyt<module>s!