Search This Blog

Friday, July 23, 2010

13. One-Time Pad

One-Time Pad

One-Time Pad (OTP) refers to a simple cipher system for encrypting a message. If used properly it is vitually unbreakable. The system is based the single use of a “key” written on a single piece of paper . These pages are often bound at the edge so when a key is used it can be destroyed. Each page is numbered and the sender and receiver must have a prearranged system for which page to use for each message.

The key consists of groups of number or letters which can be combined with the message to encrypt. The key may be a series of groups of numbers or letters. Many variations of the OTP are available. Just a simple version will be presented here.

The paintext (message) ob viously consists of letters. The first step in encrypting the text is to assign a numerical value to each letter of the (plain text) alphabet. A=0, B=1, etc. A variation on this could be using a keyword, such as OPHELIA. The alphabet would be written

O P H E L I A B C D F G J K M N O Q R S T U V W X Y Z,

And O=0, P=1, etc. The remaining letters of the alphabet are written after OPHELIA omitting any that appeared in the key word.
The next step is to take a page from the One Time Pad. It has several groups of letter in random order. Each letter will also have a numerical equivalent such as the two examples above. The sender and the receiver have to have identical one-time pads, if a key word is used they each have to know what the word for the day is, and finally, each must know which page of the pad is to be used for a given message.

Example

Suppose Nigel wishes to send the message "HELLO" to Boris. Assume two pads of paper containing identical random sequences of letters were somehow previously produced and securely issued to both.

Nigel chooses the appropriate unused page from the pad. The way to do this is arranged in advance. For example, they both may know Use the 12th sheet on 1 May,,” or “Use the next available sheet for the next message.” The material on the selected sheet is the key for this message.

Each letter from the pad will be combined in a predetermined way with one letter of the message. It is common, but not required, to assign each letter a numerical value: e.g. "A" is 0, "B" is 1, and so on. In this example, the technique is to combine the key and the message using modular addition. The numerical values of corresponding message and key letters are added together, modulo 26. If key material begins with "XMCKL" and the message is "HELLO", then the coding would be done as follows:
H E L L O message
7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message
+ 23 (X) 12 (M) 2 (C) 10 (K) 11 (L) key
= 30 16 13 21 25 message + key
= 4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z) message + key (mod 26)
E Q N V Z → ciphertext
If a number is larger than 25, then the remainder after subtraction of 26 is taken in modular arithmetic fashion. This simply means that if your computations "go past" Z, you start again at A.
The ciphertext to be sent to Boris is thus "EQNVZ". Boris uses the matching key page and the same process, but in reverse, to obtain the plaintext. Here the key is subtracted from the ciphertext, again using modular arithmetic:
E Q N V Z ciphertext
4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z) ciphertext
- 23 (X) 12 (M) 2 (C) 10 (K) 11 (L) key
= -19 4 11 11 14 ciphertext — key
= 7 (H) 4 (E) 11 (L) 11 (L) 14 (O) ciphertext — key (mod 26)
H E L L O → message
Similar to the above, if a number is negative then 26 is added to make the number positive.

Thus Boris recovers Nigel's plaintext, the message "HELLO". Both Nigel and Boris destroy the key sheet immediately after use, thus preventing reuse and an attack against the cipher.

The classical one-time pad of espionage used actual pads of minuscule, easily-concealed paper, a sharp pencil, and some simple arithmetic. The method can be implemented now as a software program, using data files as input (plaintext), output (ciphertext) and key material (the required random sequence).

For more on this example see the article on One-Time Pads in Wikipedia. For a comment on how the Germans misused OTP see West, Nigel (2006). Historical Dictionary of International Intelligence. Lanthan, MD: The Scarecrow Press.

No comments:

Post a Comment