 Introduction :

 Symmetric algorithm cryptography uses the same key for the coding and decoding processes; this key is most often called “secret” (as opposed to “private”) because all the security of the whole is directly linked to the fact that this key is only known by the sender and the recipient. This type of cryptography usually works according to two different processes, block encryption (DES, AES, Skipjack…); and streaming stream encryption (RC4 algorithm) and often use random number generation algorithms requiring randomness.
 The uses of random numbers in cryptography are diverse: generation of keys, generation of initialization vectors in symmetric cryptography, randomization in asymmetric cryptography. Statistical tests verify the good statistical distribution of the hazard generated, but none of the existing tests guarantee the unpredictability of a source of random numbers. The unpredictability of the cryptographic hazard is not studied on the generated bit sequence but on the generation algorithm. In general, it is recommended to reprocess the hazard from an uncontrolled random source to guarantee its unpredictability.

 The cryptographic mechanisms presented above act on data of well defined format. The definition of block cipher algorithms induces a natural way of encrypting blocks of fixed size. There are, however, different ways to use these primitives to encrypt messages of any size, called operating modes. Historically, operating modes have been extensively studied for their properties of propagating errors during various scenarios of data modification during encryption. The most natural mode consists of cutting the message into blocks of n bits, and applying the encryption function to each of these blocks with the encryption key.
 Introduction to cryptography :
 Block encryption modes CBC (Cipher Block Chaining):

 Before looking at the construction of the block encryption algorithm itself, it is useful to specify that there are several modes which allow the encryption of different blocks of size n, mi for i varying from 0 to t − 1, the EK encryption function then applying to each of the blocks. It is therefore a question of chaining the ci = EK (mi) with in general mi + 1 for i varying from 0 to t − 1. Where K denotes the key used by the algorithm, E denotes the encryption itself, M (or m, mi) denotes the message in clear (i.e. a block) and C (or c, ci ) the resulting figure. However, not all algorithms allow you to use all possible modes. We can cite: the CBC mode of English Cipher Block chaining which uses a chain encryption. To better understand, let’s see this mode in more detail.

 The widely used encryption mode is CBC (block chaining). It consists of encrypting the block i previously combined by or exclusive with the encryption of the previous block as well,

 Description of the operating mode:
 ci = EK (mi ⊕ci − 1) for all i from 1 to t, with c0 = EK (m0 ⊕IV) where IV denotes an initialization vector. It is a block of random data which allows the encryption of the first block to start and thus provides a form of chance independent of the document to be encrypted. It does not need to be encrypted itself during transmission, but it should never be reused with the same key. In this mode, an exclusive OR is applied to each block with the encryption of the previous block before it is itself encrypted. In addition, in order to make each message unique, an initialization vector (IV) is used. This initialization vector changes with each session, and must be transmitted to the recipient. On the other hand, it is not necessary to encrypt it before sending it: it can be known to the opponent.
 Block encryption modes CBC (Cipher Block Chaining):
To decrypt a block of encrypted text in CBC mode, the decryption algorithm is applied to the encrypted block and then it is combined by or exclusive with the preceding encrypted block, respectively with the initialization vector, in the case of the first block. The following operations are therefore carried out:
 The advantages and disadvantages :
 Benefits :
 This mode has several advantages, and also a big disadvantage. CBC mode encrypts the same clear message differently with different initialization blocks. In addition, the encryption of a block also depends on the previous blocks, and therefore, if the order of the blocks in the cryptogram is changed, decryption is impossible and the recipient realizes the problem. In addition, if a transmission error affects the encrypted block ci, then only the blocks mi and mi + 1 will be affected, the other blocks will be determined correctly.
 Disadvantages :
 The main drawback of this mode is its slowness. Imagine that we want to do encryption / decryption in real time, and simultaneously (case for example of a telephone communication) and that the encryption and decryption algorithms CK and DL are quite long to implement. Then the recipient, to start decryption of ci, must wait to have finished that of ci − 1. Thus, the time between encryption and decryption with CBC mode may be too long for these kinds of applications.
 Benefits :