Padding (cryptography)

Padding ( top up from English to pad ') is a term used in computer science for filling data with which an existing dataset is increased. The padding bytes are also known as pad bytes. The data used for checksums do not count for padding.

Padding is used primarily to bring existing data in the form of a set by an algorithm or protocol structure. Not in accordance with the existing data of the structure - for example, a sequence of 50 bits in an algorithm that operates on a block of 64 bits in length - this must be extended with suitable bit or byte strings. The choice of the padding can in this case - depending on the application - from simplem padding with zeros (zero padding) extend to complex schemes.

Padding in cryptography

In classical cryptography, Padding variable length, however, was used to conceal the beginning and end of the contents of consigned cipher. Thus, it should be difficult cryptanalysts, the position of fixed terms - about the sender or a salutation - to guess and decipher with the help of such a " Crib " the message. In modern cryptography - the simple " Cribs" are no longer relevant due to the complexity of the algorithms - has the padding in addition to pure padding also has the task to increase the security of the algorithm.

In the case of Merkle Damgård hash functions - the most used form of cryptographic hash functions - the padding is used to make the message length to a multiple of the block length of the compression function.

With symmetric block cipher padding is also used to adapt the plain text to the block length. Most operating modes (eg, ECB, CBC ) require as input a plain text whose length is a multiple of the block length. At the padding of the plaintext following claims are made:

  • Any plain text can be adjusted to a multiple of the block length.
  • The padding is clearly invertible.
  • The average length of the expansion should be minimal.

In order to meet these criteria, it makes sense to each plaintext a specified character ( eg "1 " ) to attach and then with a different character ( eg "0 " ) to replenish.

In asymmetric cryptography, especially in the RSA cryptosystem is the padding the result (for example, the ciphertext or the digital signature ) randomize. It is thereby achieved that, when the same message twice encrypt two different cryptograms generated. To achieve this, in addition to filling with random bit strings of a fixed format also more modern Padding with stronger security guarantees such as Probabilistic Signature Scheme or Optimal Asymmetric Encryption Padding can be used. Standards for Padding for RSA are defined eg in PKCS # 1 or ISO 9796.

Padding in the computer science

Outside of cryptography can be found padding in network protocols, various fixed structured file formats such as graphics files, as well as general ( ie both in files and in computer memory) in various data structures must comply with the rules of this kind, for example, the beginning of new elements only on straight or addresses divisible by four, for example, see the Interchange File Format. When music files padding is used when metadata are at the beginning of the file. This allows the metadata to be changed in length ( with correspondingly otherwise change the padding ) without the whole file has to be rewritten ( since the position of user data remains unchanged).

Swell

  • Software Engineering
  • Cryptology
629763
de