%PDF- %PDF-
Direktori : /usr/lib64/python2.7/site-packages/Crypto/Cipher/ |
Current File : //usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyc |
� �/�Oc @ sQ d Z d Z d d l m Z d d d � � YZ d � Z d Z e d d � Z d 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 XORCipherc B s) e Z d Z d � Z d � Z d � Z RS( s XOR cipher objectc O s: t j | | | � | _ | j j | _ | j j | _ d S( sU Initialize a XOR cipher object See also `new()` at the module level.N( R t newt _ciphert block_sizet key_size( t selft keyt argst kwargs( ( s7 /usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyt __init__( s c C s | j j | � 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). ( R t encrypt( R t plaintext( ( s7 /usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyR 0 s c C s | j j | � 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). ( R t decrypt( R t ciphertext( ( s7 /usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyR ; s ( t __name__t __module__t __doc__R R R ( ( ( s7 /usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyR % s c O s t | | | � 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 ( R R R ( ( s7 /usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyR F s i i N( i! ( R t __revision__t Crypto.CipherR R R R t xrangeR ( ( ( s7 /usr/lib64/python2.7/site-packages/Crypto/Cipher/XOR.pyt <module> s !