Block size (cryptography) facts for kids
When you send a secret message, you want to make sure only the right person can read it. In the world of secret codes, some methods work by breaking your message into small, fixed-size chunks. These chunks are called blocks. The size of these blocks is known as the block size.
Contents
What is a Block Size?
Block ciphers are like special machines that scramble information in fixed-size pieces. Imagine you have a long message. A block cipher takes a piece of that message, say 128 bits long, and turns it into a secret code of the exact same length. It's like putting a puzzle piece into a scrambler and getting a scrambled piece of the same size back.
How Block Ciphers Work
Block ciphers are a type of symmetric-key algorithm. This means the same secret key is used to both lock (encrypt) and unlock (decrypt) the message. The original message is called the plaintext. After it's scrambled, it becomes the ciphertext.
The block size is super important. It tells you how many bits (tiny pieces of information, like a 0 or a 1) are processed at once. For example, if a block size is 64 bits, the cipher will take 64 bits of your message, scramble them, and output 64 bits of secret code. The output must always be the same length as the input. This is because you need to be able to unscramble the message and get back to the original.
Common Block Sizes
Different secret code systems use different block sizes.
- The DES is an older system. It uses a block size of 64 bits, which is 8 bytes.
- The AES is a much newer and stronger system. It uses a block size of 128 bits, which is 16 bytes.
The original design for AES, called Rijndael, could actually support block sizes of 128, 192, and 256 bits. However, when AES was chosen as the standard, only the 128-bit block size was adopted.
Flexible and Unusual Block Sizes
Most block ciphers have a fixed block size. But a few, like RC5, can change their block size. This means you could choose if you want to process 64 bits or 128 bits at a time, for example.
Sometimes, special methods can make a cipher act like it has a larger block size. This is done by combining simpler ciphers in clever ways.
There are also some ciphers with very unusual block sizes. For instance, the 3-Way block cipher uses a block size of 96 bits, which is 12 bytes. This is different from the more common 64 or 128 bits.