Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/site-packages/Crypto/Cipher/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/site-packages/Crypto/Cipher/__pycache__/XOR.cpython-35.pyc



���^�
�@sTdZdZddlmZGdd�d�Zdd�ZdZedd�Zd
S)z�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__
z$Id$�)�_XORc@s:eZdZdZdd�Zdd�Zdd�ZdS)	�	XORCipherzXOR cipher objectcOs:tj|||�|_|jj|_|jj|_dS)zUInitialize a XOR cipher object
        
        See also `new()` at the module level.N)r�new�_cipher�
block_size�key_size)�self�key�args�kwargs�r�D/opt/alt/python35/lib64/python3.5/site-packages/Crypto/Cipher/XOR.py�__init__(szXORCipher.__init__cCs|jj|�S)z�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).
        )r�encrypt)rZ	plaintextrrr
r0s	zXORCipher.encryptcCs|jj|�S)z�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).
        )r�decrypt)rZ
ciphertextrrr
r;s	zXORCipher.decryptN)�__name__�
__module__�__qualname__�__doc__rrrrrrr
r%srcOst|||�S)z�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)r	r
rrrr
rFs
r�� N�!)	r�__revision__Z
Crypto.Cipherrrrr�rangerrrrr
�<module>s!