TOPSECCRET: Concepts

 

Encryption and the Vernam Cipher

The purpose of encryption, generally speaking, is to provide a means of communication that is secure; that is to say, no one but the intended recipient will receive the message. It is difficult to ensure such privacy, and it is impossible to be completely certain that your communication has not been overheard, no matter what precautions you take. However, encryption technology can go a long way towards decreasing the probability that your communication will be intercepted. Instead of trying to hide the communication, or trying to keep anyone from "overhearing" it, encryption techniques are designed to "cloak" your message, so that it cannot be understood. Of course, you want the intended recipient to understand the message; hence decryption, the process of "decloaking" the message and returning it to its original form. There are far too many different forms of encryption to completely list here, however, there are some good references available on the Internet. See the section titled Related Cryptography Links for more information.

The method of encryption employed in TOPSECCRET is known as the Vernam Cipher, and more specifically, a One-time Pad encryption technique. The Vernam Cipher technique, in binary, essentially uses the XOR (eXclusive-OR) operation on two bits (one from the data to be sent, and one from the password data) to produce a third bit: the encrypted message, or cipher text. For example, if the first bit of the data in the message was a 1, and the first bit of the password data was a 1, the resultant cipher text's first bit would be a 0, or 1 XOR 1. This is done once for every bit in the data to be sent. In order to decrypt the cipher text's first bit, we simply repeat the same process (a useful feature of the Vernam Cipher is that by encrypting data with the same password twice, we return it to its original form). Taking the last example, the cipher text's first bit (found to be 0), when XORed with the first bit from the password (1), results in 0 XOR 1, which is a 1, the same as the first data bit of the original message. If we call our message data, in binary, Data Stream A, and our password Data Stream P, and the cipher text generated by streams A and P Data Stream C, the operation would result in a table such as the following, using random digits for streams A and P:
 

 Encryption Table

A
0
0
1
1
0
1
0
1
P
1
1
1
0
0
1
0
0
C
1
1
0
1
0
0
0
1
 Decryption Table
C
1
1
0
1
0
0
0
1
P
1
1
1
0
0
1
0
0
A
0
0
1
1
0
1
0
1
 

Note that the tables for Encryption and Decryption are simply the same data, in a different order. In both tables, the first two rows of the table are XORed to produce the third row. The only difference is that in the first table, the operation is performed with the original data and the password as the "knowns", generating the cipher text, and in second table, the operation is performed using only the cipher text obtained from the first table and the password as the "knowns", generating the original data from them. Obviously, the password data must be known both during encryption and decryption. In fact, it is impossible to regenerate the original data stream from the cipher text stream through a XOR operation without using the exact same password. This is the fundamental principle on which the Vernam Cipher is based.

Commonly, the password data used in a Vernam Cipher is not as long as the message being sent, and so, the password is repeated several times, until its length is sufficient to match the transmission length. This may seem innocent enough, but in reality, it is extremely simple for a cryptologist to decrypt most messages sent using the technique, even without the password. Obviously, this is a serious problem. For more information on how it is possible to decrypt a message that has been encrypted with a repeated form of the same password, read the section titled Taking the Concepts a Step Further which describes the technique. While it is possible to "break" a Vernam Cipher that uses a repeated password, it is quite impossible to break a Vernam Cipher which never reuses the password data, without first guessing the password. However, this implies that the password data is the same length as the message being sent, and therefore (in theory) just as difficult to guess as the content of the message. Techniques which make use of this principle are called One-time Pads. In such schemes, the weakest part of the encryption is typically the source of the password data. If a cryptologist can narrow down the possible values which the password data contains, that is a large step towards decrypting the data stream. Thus it is important to have a password data stream which is generated from random data (as opposed to psuedo-random, a topic discussed in Taking the Concepts a Step Further). Computers are not currently capable of generating truly random data, so it is a good idea to use "real world" input sources to help determine the random password. It is critical that the password source not be accessible to anyone who might wish to eavesdrop on your transmissions.

TOPSECCRET will use randomly generated data from any source, in file sizes of 256Kb (kilo-bits) for password data. The data file is stored on two identical EPROM or EEPROM chips, and the original is then erased. The two chips are then used by the TOPSECCRET terminals to communicate securely, until all the password data on the chips has been used once, after which an alarm is sounded to indicate that the chips must be refreshed with new random data.
 

The Data Bus

In order for the two TOPSECCRET terminals to communicate efficiently, a data bus was designed to handle communications over the same set of wires in both directions. The bus is wide enough to transmit 8 bits in parallel, and the circuit was designed to encrypt as much as 8 bits per transmission. Each of the data lines in the bus carries one bit, and is connected to the outputs of an octal buffer and the inputs of a D type flip-flop, at both ends. The octal buffer is a tri-state logic device, meaning that its output can be disabled. The purpose of this design is to allow two way communication over the data lines, without allowing one transmission to interfere with the other. While the octal buffer (which is used for transmission) on one terminal has its outputs disabled, the other terminal may enable the output on it's octal buffer in order to send data across the lines. If we label one of the terminals A and the other terminal B, terminal A is sending whenever terminal B is receiving, and vice versa. In order for one of the terminals to receive, it uses the D type flip-flop, which acts as a "listening" device, with its inputs attached to the bus lines. When a terminal is ready to receive data, it simply "clocks" the D type flip-flop, reading in the current status of the bus lines. In the actual circuit, as implemented, there is a period of time where the data bus is inactive, neither sending nor receiving, while the terminals at either end go through an update cycle. More on this, along with information on the precise timings used to control the clocks, is in the next section titled Implementation.

Parity Checking

In order for the communication between the two data terminals to be considered reliable, we must have a means of checking to ensure that there is no interference, or noise, in the signal being received. If it is determined that the data received by a terminal is incorrect, an alarm must sound to inform the user. One method commonly used to determine the validity of data sent over communications lines is known as a parity check. Essentially, the parity check employed in this project is simply a bit of data that is toggled on if the number of 1s in the rest of the data is odd, and off if the number of 1s in the reset of the data is even. An easy way to calculate the status of the parity bit is to XOR each of the bits in the data to be sent with each other. For example, if you are transmitting 5 bits of data, with the values 11001, you would use: (((1 XOR 1) XOR 0) XOR 0) XOR 1), or any valid re-arrangement thereof. If you work it out, it results in a 1 for the parity bit, which is correct, since there were an odd number of 1s in the data. Had there been an even number, the XOR operations would return a 0. So, in order to see if a high bit was lost or gained during the transmission, the parity bit is calculated at the terminal which is transmitting, and sent along with the data. Then, on the receiving end, the parity bit is recalculated based on the received data, and compared to the original. If the parity bits do not match, an error has occured. This will not catch 100% of the errors, however, as it is possible we may lose or gain an even number of high bits (in this case, two or four), which would result in the same parity bit. It is likely to catch most of the errors, however, since it is unlikely that two or four high bits exactly will be lost or gained in the five bit transmission at the same time.
 
 

Return to the TOPSECCRET Homepage  or move on to Implementation.
 
 

TOPSECCRET -- It works in theory.