From the course: Symmetric Cryptography Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Padding

Padding

From the course: Symmetric Cryptography Essential Training

Start my 1-month free trial

Padding

- [Instructor] When we're dealing with cryptographic algorithms, we assume that the data we're dealing with is going to be in whole bytes. Also, block ciphers expect that they're going to operate on entire blocks, so if you have a block cipher that's expecting a 64-bit block, and it only gets one byte, we have to fill in the rest of that 64-bit block. There's a number of different ways that we can do this, one of which is called bit padding, and we append a byte, which is a one bit followed by seven zero bits, and then one or more zero bytes to fill the rest of the block. There's the ANSI X.923 standard, which appends at least one byte. Each of them is a zero byte with the last one equal to the number of bytes padded. So if we padded out six bytes, the last byte would be equal to the number six. The PKCS#7 standard appends at least one byte. Each has the same value. That's the number of bytes that are in the pad. In the previous example, we talked about padding with six bytes. In this…

Contents