1 @c acl_streamciphers.texi
2 @section Stream ciphers
3 A stream cipher normally generates a deterministic, random looking stream of
4 bits, known as key stream. For encryption purpose this key stream is XORed with
5 the data stream. So decryption is exactly the same as encryption. The
6 data-stream is XORed with the key stream giving the plaintext. So both sides
7 need exactly the same stream cipher in the same state.
9 @subsection List of available stream ciphers
10 The following stream ciphers are currently implemented:
12 @item ARCFOUR (RC4 compatibel)
19 @subsection High frequent parameters
24 64 bit, 80 bit, 128 bit
29 @subsection Parts of a stream cipher
31 @item generation algorithm
32 @item initialization algorithm
36 As we can see all stream ciphers seem to utilize an internal state which
37 determines the output. This state is initialized by the initialization
38 algorithm with a key and an IV (initialization vector). It is very important
39 for security that _never_ the same key with the same IV is used again. The
40 IV is not required to be kept secret.
42 @subsection API of stream ciphers
43 The API is not always consistent due to the fact that we tried to optimize the
44 code for size (flash, heap and stack) and speed (runtime of the different
47 Generally the API of the implemented stream ciphers consists of:
50 function, which implements the initialization
53 function, which implements the streamcipher algorithm and generates a
57 context type, which contains internal state information
61 @subsubsection @code{*_init} function
62 The *_init function generally takes a pointer to the key as first parameter.
63 For ciphers where the keysize is not fixed the second parameter gives the
64 keysize (in bits regularly) followed by a pointer to the IV and a length
65 parameter for not fixed IV sizes (both are omitted if the algorithm does not
66 specify IV handling, in this case a part of the key should be used as IV).
67 The last parameter points to the context variable to fill.
69 @subsubsection @code{*_gen} function
70 The *_gen function updates the internal state to which a pointer is given as
71 parameter and returns a fixed length part of the keystream as return value.
75 @subsection Stream cipher abstraction layer (SCAL)