Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Mode of operation, ECB, CBC, initialisation vector, padding, CTR, padding oracle?

Dikenal juga sebagai: mode of operation · ECB mode · CBC mode · initialisation vector · padding · CTR mode · padding oracle

Definition 27.5 University Computer Science — Year 3 · Bab 27 — Symmetric Cryptography and Hash Functions

A mode of operation encrypts a message of several blocks P1,…,PnP_1, \ldots, P_n with a block cipher. ECB mode encrypts each block alone: Ci=Ek(Pi)C_i = E_k(P_i). CBC mode chains them: Ci=Ek(Pi⊕Ci−1)C_i = E_k(P_i \oplus C_{i-1}), starting from C0C_0, an initialisation vector (IV) that must be unpredictable and is sent with the ciphertext; decryption computes Pi=Dk(Ci)⊕Ci−1P_i = D_k(C_i) \oplus C_{i-1}. Padding extends the message to a whole number of blocks; PKCS#7 padding adds pp bytes of value pp, 1≤p≤161 \le p \le 16, and is checked and removed after decryption. CTR mode turns the block cipher into a stream cipher: Ci=Pi⊕Ek(ctr+i)C_i = P_i \oplus E_k(\mathit{ctr} + i), with a counter block that must never repeat under one key. A padding oracle is any way for an attacker to learn whether the padding of a ciphertext of its choice was valid.

A picture of 96 × 64 one-byte pixels, drawn from figures/ecb.dat, encrypted with AES-128. In ECB each run of 16 equal pixels becomes the same 16 bytes, and the shapes stay visible; in CBC the ciphertext looks random. A picture of 96 × 64 one-byte pixels, drawn from figures/ecb.dat, encrypted with AES-128. In ECB each run of 16 equal pixels becomes the same 16 bytes, and the shapes stay visible; in CBC the ciphertext looks random. A picture of 96 × 64 one-byte pixels, drawn from figures/ecb.dat, encrypted with AES-128. In ECB each run of 16 equal pixels becomes the same 16 bytes, and the shapes stay visible; in CBC the ciphertext looks random.
A picture of 96×6496 \times 64 one-byte pixels, drawn from figures/ecb.dat, encrypted with AES-128. In ECB each run of 16 equal pixels becomes the same 16 bytes, and the shapes stay visible; in CBC the ciphertext looks random.
Two modes. In CBC each ciphertext block feeds the next encryption, so equal plaintext blocks encrypt differently, and encryption is sequential. In CTR the cipher only produces a keystream from the counter, and the blocks can be computed in parallel; a repeated counter repeats the keystream.
Two modes. In CBC each ciphertext block feeds the next encryption, so equal plaintext blocks encrypt differently, and encryption is sequential. In CTR the cipher only produces a keystream from the counter, and the blocks can be computed in parallel; a repeated counter repeats the keystream.
Baca dalam konteks →