{Notes to self, programming, technology, linux, windows, git} U {Papers, reviews, games, coffee, tabletennis, ramblings} = {things worth saving}

Wednesday, March 25, 2009

On security: One-time pads

Problem

We’re trying to compromise a One-Time Pad by applying facts we have about the original message. Bits 0-20 (LSB first) contain salary information. What we’re trying to do is to get the recipient of the salary an extra mill. A message will be mentioned as m, a key will be mentioned as k and a ciphertext will be mentioned as c.

Solution

What do we know? We know that the salary is encoded in m in bits 0-20, and we know that we get paid less than a million per month. This is enough information to manipulate m encoded with a One-Time pad! In binary 1 million has MSB 1, using our own encoded notation. We know
that the one-time pad uses XOR to generate c using k. Knowing the location of the MSB in the encoded message, and knowing what it should be, to get an extra million (1), we can change the original message to our liking. For example, if the bit corresponding to our salary MSB bit in c is 0, and we know that we do NOT get paid a million or more, then the corresponding bit in m should also be 0, which means the corresponding bit in k is 0 aswell. Now we can change the bit in c to our liking, 1, which adds a million to our salary.

One-time pad security

The only reason we have been able to compromise the One-Time Pad is because we have enough knowledge about m, to make certain changes. If we did not know anything about the original message, c would be total jibberish.

(solution to old assignment from dSik)

No comments:

Followers