__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.
-
|