__init__(self,
password=None,
cipher_algo=3,
cipher_mode=0,
IV=None,
hash_algo=5)
(Constructor)
Initialize the encryption cipher. The parameters used here are
the following:
password - Password to use for encrypting the data. This
string must be of the corrent length for the
selected cipher algorithm. Special value None means
to create a session password, which can be
retrieved using the password property of the
created instance.
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 have safe defaults, thus it is safe just to
instantiate this class.
-
|