This question relates to bit flip attacks on OTP encrypted messages.
Lets say I've got a list of numbers from 0 to 2^24-1
I want to re-order the list so it has the following property:
If you start at a random (unknown) position and go forward 1 step, I want it to be as hard as possible to guess how the the value will change. Assuming the re-ordered list is known. The list is circular.
Edit: By changes I mean "which bits in the value will flip". To put it another way:
- Attacker knows value from list AFTER OTP is applied (they don't know the actual value)
- Attacker does something which they know will cause the list position to step forward 1.
- Attacker wants to guess what the new value will be AFTER OTP.
Examples:
For a simple ordered sequence 1,2,3,4... It's quite easy. If you go forward one step in the sequence, 50% of the time this will cause only the LSB to toggle. Chance of correct guess: 1/2
I tried a few completely random sequences and found the most common changes occurred 9-10 times. Chance of correct guess: 10/2^24.
1/2^24 would be considered "perfect". Since that's the base chance of guessing without knowing anything.
So my question is. How would I go about choosing the order to maximize the difficulty of this guess.
Edit2: I will try to describe the problem using the notation from the comments.
Start with a list of all possible values for a 24 bit number, in order. 0,1,2,3, etc. We will call this list U.
We will re-order this list in some way, generating list V.
An index in the list is chosen at random. We will call this i.
An attacker has access to V, but not i
The attacker must guess the value Vi⊕V(i+1modn)
The goal is to modify the list in such a way as to maximize the difficulty of this guess.
Some thoughts: To achieve 1/2^24, each difference would have to appear exactly once. I'm not sure that's even possible.