Package yawPyCrypto :: Module KeyCipher :: Class KeyEncryptCipher
[show private | hide private]
[frames | no frames]

Class KeyEncryptCipher

             object --+    
                      |    
         KeyEncryptBase --+
                          |
             object --+   |
                      |   |
            EncryptBase --+
                          |
     object --+           |
              |           |
     StreamBase --+       |
                  |       |
       OutputStream --+   |
                      |   |
     object --+       |   |
              |       |   |
AlgoDefinitions --+   |   |
                  |   |   |
       CipherStream --+   |
                      |   |
          EncryptStream --+
                          |
                         KeyEncryptCipher


Key encryption cipher class. This is the main entrypoint for all stream encryption which is to be done side by side with public key ciphers, so that more data than can be encrypted than using the normal public key encryption schemes. An instance of this class works similar to an instance of the EncryptCipher class.
Method Summary
  __init__(self, enc_keys, sign_keys, cipher_algo, cipher_mode, IV, hash_algo)
Initialize the encryption cipher.
a new object with type S, a subtype of T __new__(S, ...)
  feed(self, data)
Feed data to the encryption. (inherited from EncryptBase)
  finish(self)
Finish the encryption stream. (inherited from EncryptBase)
  _checkInst(self)
Instance checker. (inherited from EncryptStream)
  _CipherStream__getPass(self)
Retrieve the password this stream uses. (inherited from CipherStream)
  _encryptionEnd(self)
Write out the encryption end packet. (inherited from EncryptBase)
  _encryptionHeader(self)
Write the encryption header. (inherited from KeyEncryptBase)
  _encryptionRandom(self)
Write out the random first block of data. (inherited from EncryptBase)
  _encryptionSignature(self)
Write out the key signatures for this stream. (inherited from KeyEncryptBase)
  _feedEncrypt(self, data)
Feed the passed in packet to the encryption, and return any available data which comes back from the encryption routine. (inherited from EncryptStream)
  _feedEncryptRaw(self, data)
Feed the passed in packet to the encryption, and return any available data which comes back from the encryption routine. (inherited from EncryptStream)
  _feedOutput(self, ptype, pdata)
Feed packet to the output stream. (inherited from OutputStream)
  _start(self, cipher_algo, cipher_mode, IV, password, hash_algo)
Start the encryption stream with the passed in parameters, and create the crypto objects needed for the stream. (inherited from CipherStream)
  _stop(self)
Stop the encryption object by appending random data to the end of the buffer, so that a final block can be written if data is still pending encryption. (inherited from EncryptStream)
  _StreamBase__getData(self)
Retrieve the data from the output property as a string. (inherited from StreamBase)
  _writeOutput(self, data)
Append data to the output. (inherited from StreamBase)

Method Details

__init__(self, enc_keys=[], sign_keys=[], cipher_algo=3, cipher_mode=0, IV=None, hash_algo=5)
(Constructor)

Initialize the encryption cipher. The parameters used here are
the following:
    
    enc_keys - List of keys for which the stream will be
               encrypted. Any of the private keys belonging to
               the (public) keys passed in will be able to decrypt
               the cipher stream.
    sign_keys - List of keys with which the stream will be signed.
                If you pass in more than one key, the stream will
                be signed by all of these keys. On decryption,
                using any of these keys public part will mark the
                stream as being signed.
    cipher_algo - One of the CIPHER_* constants, specifying the
                  cipher algorithm to use.
    cipher_mode - One of the MODE_* constants, specifying the
                  cipher block mode to use. Special constant is
                  MODE_NONE, which must be used with stream
                  ciphers, and when used with block ciphers means
                  to use the standard mode of that cipher
                  (MODE_CBC).
    IV - Initialization value for block chaining modes. This must
         be at least as long as the blocksize of the algorithm
         which is used. Special value None means that the default
         IV, declared in _Imports, is used. It is actually not
         necessary, nor safer to pass a custom IV, as the first
         block of data written for block ciphers is always a
         random block of data, which seeds the IV to a default
         value for the actual data. IV is only used on block
         ciphers.
    hash_algo - One of the HASH_* constants, specifying the hash
                algorithm to use for the stream signature.
                
All arguments except enc_keys and sign_keys have safe defaults.

__new__(S, ...)

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

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