Package yawPyCrypto :: Module _CipherBase :: Class DecryptBase
[show private | hide private]
[frames | no frames]

Class DecryptBase

object --+
         |
        DecryptBase

Known Subclasses:
DecryptCipher, ZipDecryptCipher, ZipKeyDecryptCipher, KeyDecryptCipher

DecryptBase is an abstract base class which implements the feed() and finish() methods for decryption streams. feed() takes string data, which is passed to the underlying stream handler, and decrypted. Input is finished on calling the finish() method, which also checks whether the stream was complete.
Method Summary
  __init__(self, password, IV)
Initialize the decryption cipher.
a new object with type S, a subtype of T __new__(S, ...)
  feed(self, data)
Feed data to the decryption.
  finish(self)
Finish the decryption stream.
  _encryptionEnd(self, pdata)
Read the encryption end packet.
  _encryptionHeader(self, pdata)
Reads the encryption header.
  _encryptionPacket(self, pdata)
Called when an encrypted data packet is found.
  _encryptionSignature(self, pdata)
After the encryption end packet has been processed, an encryption signature may be present, but is not in a normal encryption stream.
  _encryptionStart(self, pdata)
Start of encryption stream packet.
  _feedPacket(self, ptype, pdata)
This method is called by InputStream to feed packets as they are found in the stream.

Class Variable Summary
bool _showpassword

Method Details

__init__(self, password, IV=None)
(Constructor)

Initialize the decryption cipher. As information regarding the algorithm used is taken directly from the stream, you only need to pass the password and the optional IV passed to the EncryptStream to initialize this object. The arguments taken from the stream and these parameters are passed to the decryption start function of the underlying stream.

__new__(S, ...)

Returns:
a new object with type S, a subtype of T

feed(self, data)

Feed data to the decryption. The data must be a string. Calling this function does not necessarily produce output, as only complete packets will be processed.

finish(self)

Finish the decryption stream. This function actually only checks whether the stream already contained an end-marker, and in case it didn't, invalidates the stream, and raises an error.

_encryptionEnd(self, pdata)

Read the encryption end packet. This packet contains a stream signature, which allows to check whether the data from the stream was read correctly, and the total length of the encrypted stream, which is used to skip the appended random data found in the encrypted stream.

_encryptionHeader(self, pdata)

Reads the encryption header. Normally the encryption header is not present on encrypted streams, unless a derived class has been used to create one. This happens in the Key*Cipher classes.

_encryptionPacket(self, pdata)

Called when an encrypted data packet is found. This packet is decrypted, and appended to the available output.

_encryptionSignature(self, pdata)

After the encryption end packet has been processed, an encryption signature may be present, but is not in a normal encryption stream. This kind of packet is used in the Key*Cipher classes.

_encryptionStart(self, pdata)

Start of encryption stream packet. This packet contains information on the cipher algorithm, the cipher mode, and the hash algorithm used to encrypt the stream. It reads the algorithm information from the stream, and starts the decryption object in case all information is available.

_feedPacket(self, ptype, pdata)

This method is called by InputStream to feed packets as they are found in the stream. This function reads the packet, and decides what to do based on the packet type that is found. This function also checks the internal structure of the encrypted stream.

Class Variable Details

_showpassword

Type:
bool
Value:
False                                                                  

Generated by Epydoc 1.1 on Sun Aug 17 03:32:34 2003 http://epydoc.sf.net