# what is the block in crypto

Sorry for the newbie question, I'm new to cryptography and I have difficulty in understanding what the block is. For example for DES algorithm the block size is 64 bits and the key is equal to 2 to the power of 56. Can someone explain this to me ? Maybe like I'm 5?

Lots of practical cryptographic algorithms operate on variable length inputs. E.g., if you're encrypting messages, you want your algorithm to be able to handle messages of any reasonable length.

But the way cryptographers usually build algorithms capable of handling variable length inputs is by splitting the problem into two parts:

1. Design a basic algorithm—often called a primitive—that works only on fixed-size inputs.
2. Design an extender algorithm (often called a mode of operation or just a mode; or sometimes called a construction) that uses a primitive as the basic building block for processing variable-length messages.

DES and AES are block ciphers, which means they are primitives. Their block sizes (64 and 128 bits respectively) is just how much data each one of them processes in a single call. An extender algorithm will typically break up the inputs into blocks of the primitive's supported size, and use a separate call to the block cipher to process each block.

Block size is often an important security parameter for cryptographic algorithms, because it tends to put a limit to how many times you can securely call the primitive with the same key. For example, since DES has a 64-bit block size, when you use DES or 3DES many extender algorithms' security breaks down if you process more than $2^{32}$ blocks with the same key. So AES' 128-bit block size is a big improvement, because you tend to run into problems after $2^{64}$ blocks instead, but even there many cryptographers worry that's uncomfortably low.

• You need to surround the exponent with braces: {} in Tex, otherwise only the first character / digit will be in superscript. – Maarten Bodewes Jan 24 '18 at 12:50
• Thanks @MaartenBodewes. Not the first time I make that mistake, and I doubt it'll be the last. 🤤 – Luis Casillas Jan 24 '18 at 19:08

A "block" is the amount of bits your block cipher operates on (There are other kinds of ciphers, see below.)

Think of a Caesar cipher, it replaces letters in words. For example with key 13 it replaces as follows:

A -> N


and

HELLO ALICE -> URYYB NYVPR


Note that the same letter will always be replaced by the same letter. So it operates on one letter at a time.

A block cipher operates not on individual bits 0/1 but on blocks of them so if your block size was four your cipher might do the following replacement:

0100 -> 1110


(Of course what exactly is replaced with what depends on the key.)

Essentially, a block cipher behaves like a permutation of the blocks. Which permutation exactly, is determined by the key. So it is a bijective map $\{0,1\}^{blocksize} \rightarrow \{0,1\}^{blocksize}$.

It is not strictly required for a cipher to have a block size. A stream cipher for example operates on individual bits.

Note, that since a block cipher is a permutation it will replace the same input-block with the same output-block just like the Caesar cipher always replaces the same input-letter with the same output-letter. Because this makes for bad cryptography block ciphers are used in different modes of operation.

There are stream ciphers (which operates on 1 character a time) and block ciphers - algorithms are supposed to obtain a fixed-length block and encrypt/decrypt it as a whole.

You may see some parallel in operations of decimal numbers: you may double every digit (throwing out tens), or double the number as a whole. The last is more complicated.