Random padding

Index

  1. The basic idea
  2. Previous work
  3. Optimality
  1. The basic idea

    If a source of genuinely random numbers is available - and one doesn't mind inflating the size of the file somewhat - padding to the nearest block boundary can be done using random padding.

    This takes the form of adding between 1 and 16 bytes of random data (assuming we are padding out a 8-bit granular file out to a 128-bit block boundary).

    The exact number of bytes added has one subtracted from it, and the result is stored where the last four bits of the padding were.

  2. Previous work

    This type of random padding has been described before.

    The section entitled "Dealing with the Incomplete Byte" on John Savard's "Tying Up loose Ends" page covers a closely related scheme.

  3. Optimality

    This type of padding is optimal in the case where files are distributed in such a manner that probability of file transmission does not depend on file length.


BIAES | Bijective padding | Random padding


tim@tt1.org | http://mandala.co.uk/