« Neurosecurity? | Main | When is an IV not an IV? »

Tuesday, 21 July 2009

More ancient format-preserving encryption

In addition to the way of doing format-preserving encryption that FIPS 74 describes, there's another way that has been around for quite a while. This the technique that Michael Brightwell and Harry Smith describe in their paper "Using Datatype-Preserving Encryption to Enhance Data Warehouse Security," which they originally presented at the 1997 National Information Systems Security Conference. You can get their presentation here and a more carefully written paper here. Here's how their scheme works (ignoring an initial permutation).

Suppose that we want to encrypt a sequence of digits i1, i2, …, in in a way that maps each digit to another digit. We use the DES algorithm with a key K to do this. We first hash K to get the bytes A = (a1,…,a8) and use this value as shown in this diagram to produce the ciphertext z1 from the plaintext i1. In this diagram, the addition is done modulo 10 to ensure that we get another digit when we encrypt.

Old FPE 1  

To get the next ciphertext digit, we shift the inputs into the DES encryption function, shifting in the plaintext i1 as we do this. This diagram shows how to get the ciphertext z2 from the plaintext input i2.

Old FPE 2   

To get the next ciphertext digit, we again shift the input into the DES encryption function, this time shifting in i2. Here's how this step works when we get  the ciphertext z3 from the plaintext i3.

Old FPE 3  

We repeat this process as many times as we need to encrypt the entire sequence of plaintext digits, shifting in a new plaintext digit at each step.

Brightwell and Smith claim that their scheme is as secure as DES, but that's probably not really true. This is because adding the output of a DES encryption to a plaintext digit and then reducing the sum modulo 10 produces a bias in the ciphertext. If we're adding a random number from 0 through 255 and reducing the sum modulo 10, we'll be adding each of 0 through 5 26/256 of the time, and adding each of 6 through 9 only 25/256 of the time. Because of this, the ciphertext that we get from encrypting the digit 0 will have a different distribution than that that we get from encrypting a 1, for example.  This means that it's easy to distinguish encryption using the Brightwell-Smith scheme from a random permutation so the scheme doesn't really meet the definition of a secure one, at least by today's standards. It's still interesting, however, at least from a historical perspective.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e55375ef1c8833011570e03416970c

Listed below are links to weblogs that reference More ancient format-preserving encryption:

Comments

Post a comment

If you have a TypeKey or TypePad account, please Sign In.

Voltage Data Breach Index

  • Grab the Voltage Data Breach Index

May 2012

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31