The Crypto module provides an object-oriented framwork for encryption
and related functionality. More specifically, its objects han be
classified as follows:
- Block ciphers
- encrypt data in chunks of typically 8 bytes, using a secret
- Stream ciphers
- operate on the data to be encrypted one byte at a time, for
exemple by xoring it with a sequence of pseudorandom bytes.
- Cryptographic hash functions
- transform a bytesequence of arbitrary length into a short
string of a fixed length of typically 16 or 20 bytes, in such a
way that it is practically impossible to find two distinct
strings with the same hash value.
- Public key algorithms
- can support both encryption and digital signatures.
- Abstract building blocks
- for combining ciphers (mainly for block ciphers). These objects
behave like block ciphers, but delegate encryption to one or
several underlying objects, in some way.
For example, block ciphers are often used in a feedback mode.
The ciphers by themselves know nothing about these different
"modes of operation", instead this knowledge is abstracted into
separate objects. If you want IDEA in Cipher Block Chaining
mode, you combine an IDEA object and a CBC object.
- is essential for many cryptographic application. The toolkit
includes a few different random number generators, with varying
degrees of true randomness.
- Frontend objects
- that handle things like padding messages, or make it more
convenient to use popular combinations of ciphers, feedback