/opt/alt/python27/lib64/python2.7/site-packages/Crypto/Cipher
Edit: /opt/alt/python27/lib64/python2.7/site-packages/Crypto/Cipher/blockalgo.pyo (6307B)
Ñò
Bd\Rc @ sŸ d Z d d k Z e i d d j o" e i d d j o d d k Tn d d k Td Z d Z d Z d Z d Z d
Z
d Z d d „ Z
d
d d „ ƒ YZ d S( s4 Module with definitions common to all block ciphers.iÿÿÿÿNi i i ( t *i i i i i c C sV | i | ƒ } t | ƒ | j o) | o t d | ƒ ‚ n | | } n | p | S( sF Find a parameter in tuple and dictionary arguments a function receivess! Parameter '%s' is specified twice( t gett lent
ValueError( t namet indext argst kwargst defaultt param( ( sJ /opt/alt/python27/lib64/python2.7/site-packages/Crypto/Cipher/blockalgo.pyt
_getParameter| s t BlockAlgoc B s) e Z d Z d „ Z d „ Z d „ Z RS( s) Class modelling an abstract block cipher.c O s) t d d | | d t ƒ| _ | i | _ | i t j o+ | i | | | Ž | _ | i i | _ nÁt | _ t | _
t d d | | ƒ | _ | i p t d ƒ ‚ n | i | t t
d ƒ | i d | i d ƒ} t | i ƒ | i j oD | i | i | i d
t
d ƒ | i d ƒ | i d | _ nÁ t | i ƒ | i d j oƒ | i | _ | i | i t
d ƒ | i d ƒ | i d | _ | i d
| i d d
!j o t d
ƒ ‚ n | i d
| _ n! t d | i | i d f ƒ ‚ | i | t | i | i d | i d ƒ| _ d S( Nt modei R t ivi s MODE_OPENPGP requires an IVt t segment_sizei iþÿÿÿi iüÿÿÿs% Failed integrity check for OPENPGP IVs4 Length of IV must be %d or %d bytes for MODE_OPENPGP( R
t MODE_ECBR t
block_sizet MODE_OPENPGPt newt _ciphert IVt Falset _done_first_blockt _done_last_blockR t MODE_CFBt bR t encryptt
_encrypted_IVt decrypt( t selft factoryt keyR R t IV_cipher( ( sJ /opt/alt/python27/lib64/python2.7/site-packages/Crypto/Cipher/blockalgo.pyt __init__ˆ s>
c C sæ | i t j oÆ | i t | ƒ | i | i } | d j o] | i o t d | i ƒ ‚ n t | _ | t d ƒ | } | i i | ƒ t | ƒ } n | i i | ƒ } | i
p | i | } t | _
n | S| i i | ƒ S( sX Encrypt data with the key and the parameters set at initialization.
The cipher object is stateful; encryption of a long block
of data can be broken up in two or more calls to `encrypt()`.
That is, the statement:
>>> c.encrypt(a) + c.encrypt(b)
is always equivalent to:
>>> c.encrypt(a+b)
That also means that you cannot reuse an object for encrypting
or decrypting other data with the same key.
This function does not perform any padding.
- For `MODE_ECB`, `MODE_CBC`, and `MODE_OFB`, *plaintext* length
(in bytes) must be a multiple of *block_size*.
- For `MODE_CFB`, *plaintext* length (in bytes) must be a multiple
of *segment_size*/8.
- For `MODE_CTR`, *plaintext* can be of any length.
- For `MODE_OPENPGP`, *plaintext* must be a multiple of *block_size*,
unless it is the last chunk of the message.
:Parameters:
plaintext : byte string
The piece of data to encrypt.
:Return:
the encrypted data, as a byte string. It is as long as
*plaintext* with one exception: when encrypting the first message
chunk with `MODE_OPENPGP`, the encypted IV is prepended to the
returned ciphertext.
i sF Only the last chunk is allowed to have length not multiple of %d bytesR ( R R R R R R t TrueR R R R R ( R t plaintextt padding_lengtht paddedt res( ( sJ /opt/alt/python27/lib64/python2.7/site-packages/Crypto/Cipher/blockalgo.pyR » s '!
c C s | i t j o¢ | i t | ƒ | i | i } | d j o] | i o t d | i ƒ ‚ n t | _ | t d ƒ | } | i i | ƒ t | ƒ } n | i i | ƒ } | S| i i | ƒ S( sš Decrypt data with the key and the parameters set at initialization.
The cipher object is stateful; decryption of a long block
of data can be broken up in two or more calls to `decrypt()`.
That is, the statement:
>>> c.decrypt(a) + c.decrypt(b)
is always equivalent to:
>>> c.decrypt(a+b)
That also means that you cannot reuse an object for encrypting
or decrypting other data with the same key.
This function does not perform any padding.
- For `MODE_ECB`, `MODE_CBC`, and `MODE_OFB`, *ciphertext* length
(in bytes) must be a multiple of *block_size*.
- For `MODE_CFB`, *ciphertext* length (in bytes) must be a multiple
of *segment_size*/8.
- For `MODE_CTR`, *ciphertext* can be of any length.
- For `MODE_OPENPGP`, *plaintext* must be a multiple of *block_size*,
unless it is the last chunk of the message.
:Parameters:
ciphertext : byte string
The piece of data to decrypt.
:Return: the decrypted data (byte string, as long as *ciphertext*).
i sF Only the last chunk is allowed to have length not multiple of %d bytesR (
R R R R R R R# R R R ( R t
ciphertextR% R&