Electronic code book mode

from Wikipedia, the free encyclopedia

Electronic Code Book mode ( ECB mode ) is a mode (Mode, Mode ) for block ciphers . The name of the mode comes from the fact that code books can be created by assigning ciphertexts and plaintexts.

One operating mode allows more than one block to be encrypted with a block encryption algorithm such as Data Encryption Standard (block length 64 bits) or the Advanced Encryption Standard (block length 128 bits).

ECB is the simplest operating mode, because the plain text blocks are encrypted independently of one another. With the same key, the same plaintext blocks always result in the same ciphertext block. This is also the major disadvantage of this method, because plain text samples are retained. The following figures show the structure of the ECB during encryption and decryption:

Encryption in ECB mode
Decryption in ECB mode

If you use it to encrypt a graphic that only consists of a few black lines, with 0 (bit) standing for white and 1 (bit) for black, you will find a lot of blocks that only consist of 0. All these blocks are then also the same in the ciphertext. This would allow the drawing to be reconstructed to a deviation of a few millimeters without knowing the key.

This problem can be clearly illustrated using the following graphic, which was encrypted once in ECB mode and once in another encryption mode with block chaining, such as CBC mode:

Tux.jpg Tux ecb.jpg Tux secure.jpg
original Encrypted in ECB mode Encrypted in a chained mode

Due to the lack of block chaining, uniform and large areas that extend over several blocks can still be recognized in the cipher . It thus offers a simple target for statistical analyzes. One of the fundamental problems is that the ECB mode does not sufficiently blur the frequency of blocks in the unencrypted text due to the lack of block chaining.

These negative effects of the ECB mode are independent of the specific block encryption - even a block encryption that is per se “secure” can become “unsafe” in a specific application when used in the ECB operating mode. The implementation and use of the insecure ECB mode is mostly done by developers out of ignorance of the interrelationships and thus opens up security weaknesses that could easily be avoided. In general, a block cipher should never be operated in ECB mode if more than one block is to be encrypted.

One advantage of ECB is that individual encrypted elements can be accessed directly without having to consider other encrypted parts.

literature