MMPC: An Algorithm for Encrypting Multiple Messages
by Jim Shapiro and David Shapiro



Example 1:

(a)
for(i = 0, fi_r = fi_p; i < file_count; i++, fi_r++) {
  for(j = 0; j < fi_r->data_blocks; j++) {
    block_indices_p[get_ran(ran_array_p, &n)] = i;
  }
}

(b)
for each file
   for eack block in this file
      reset block_indices_p[random index] to the index of this file.
   end
end


Example 2:

for each output block pair
   get file index from block_indices
   if it is not chaff
      read a data block for this file
      package transform the data block
      write the transformed block to the output file
      compute the HMAC of the transformed block
      write the HMAC of the transformed block to the output file
   else
      write out fake block-HMAC bytes
   end
end

Example 3:

for indices from 0 to the next to last matching index
  if this index does not belong to a keeper
    skip the chaff data-HMAC blocks
      else
       read the data bytes
       use the (revealed) package key to decrypt this block
       if this is not the last (padding) data block
          write out the plaintext
       else
          write out the number of bytes indicated by the last byte
       end
       skip the HMAC
    end
end

Listing One
(a)
felis:~/crypt/ddj$ mmpc_snd
Using hmac_sha for digest.
How many files do you want to package-chaff   ? 2
Enter name of file                           1: real.msg
Data file "real.msg" (39 bytes) requires 6 (8) byte data blocks.
Enter key (in hexadecimal) for real.msg       : cafebabecafebabe
Enter name of file                           2: fake.msg
Data file "fake.msg" (53 bytes) requires 8 (8) byte data blocks.
Enter key (in hexadecimal) for fake.msg       : f00df00df00df00d
How many chaff blocks do you want to add      ? 245
Total blocks = 259
Enter name of ciphertext file                 : chaffed

(b)
felis:~/crypt/ddj$ mmpc_rec dead12345678dead chaffed
Expecting hmac_sha for digest.
There are 259 blocks each containing 8 bytes of data and a 20 byte HMAC.
Sorry, there is no match for "dead12345678dead" in file "chaffed".
felis:~/crypt/ddj$ mmpc_rec cafebabecafebabe chaffed
Expecting hmac_sha for digest.
There are 259 blocks each containing 8 bytes of data and a 20 byte HMAC.
I believe that Colonel Mustard did it.
felis:~/crypt/ddj$ mmpc_rec f00df00df00df00d chaffed 2>/dev/null
There is no question that the butler is the culprit.

2


