58.

Learn Encryption Techniques with BASIC and C++
(Publisher: Wordware Publishing, Inc.)
Author(s): Gil Held
ISBN: 1556225989
Publication Date: 10/01/98

Previous Table of Contents Next


Chapter 6
Using Random Numbers

Through the use of random numbers you can decrease the decipherment capability of people who illicitly gain access to an enciphered message. In fact, the use of a true random number sequence as an enciphering key theoretically makes it impossible for a person to decipher that message. Unfortunately, the use of a true random number sequence is beyond the capability of most organizations due to the time, cost, and the effort required to provide the sequence to others who must use it to decipher messages. Thus, most random number sequences are actually pseudo-random number sequences that, with varying degrees of difficulty, can be duplicated.

This chapter first discusses the ways in which true random number sequences are developed and why they are impractical for most persons and organizations. Next, you will examine the built-in random number generator included in most programming languages and learn how to use that facility to create a pseudo-random number sequence that can serve as an enciphering and deciphering key. This discussion is followed by the construction of a series of programs that illustrate the use of computer-generated random number sequences to encipher and decipher messages.

Random Numbers and Random Number Sequences

Random numbers are unordered numbers that are independent of preceding and succeeding numbers. Thus, a random number sequence is an unordered series of random numbers.

The use of random number sequences in cryptology provides a mechanism to create an unbreakable enciphered message. To illustrate this, assume the random number sequence you obtain (through a process described later in this chapter) is converted into a binary sequence. Also assume that each plaintext character in your message is converted into a binary sequence. You could use modulo 2 addition to add the plaintext and random number binary values to produce an enciphered binary sequence. If the recipient has the same random number sequence, he or she would use modulo 2 subtraction to subtract the binary values of the random numbers from the enciphered binary sequence to reproduce the plaintext message. Because the binary random number sequence functions as a unique key known only to the message encipherer and message decipherer, any person who illicitly obtains a copy of the enciphered message cannot decipher the message.


The father of the application of modulo 2 arithmetic to encipherment systems was Gilbert Vernam. Working in downtown Manhattan for American Telephone & Telegraph Company during 1917, Vernam was assigned to a project to investigate the security of the telegraph.

In 1917, the Baudot code was used for the transmission of information via telegraph. In this code, characters were represented by a predefined sequence of a combination of five marks and spaces which represented different levels of current that would be placed on the telegraph line to identify a character. Automated telegraph operations used punched paper tape for both offline message preparation as well as message transmission and reception. Marks were represented by holes, and spaces were represented by leaving the tape intact.

After studying telegraph operations, Vernam proposed punching a “key” tape consisting of randomly selected characters literally pulled from a hat. He proposed electromechanically adding the pulses on the keytape to the pulses of plaintext characters as follows:

plaintext key ciphertext
mark + mark = space
mark + space = mark
space + mark = mark
space + space = space

With Vernam’s method, if you assign a binary 1 to a mark and a binary 0 to a space, you have modulo 2 addition forming the ciphertext. Thus, it should not be surprising that Vernam’s method for reconstructing the plaintext characters was based upon modulo 2 subtraction.

Vernam’s encipherment ideas were converted from paper to hardware by the construction of two devices during 1918. These devices were connected to two teletype- writers and their successful use represents the beginning of automated cryptographic operations.


Generating Random Number Sequences

A true random number sequence is not only an unordered sequence of numbers but also a non-reproducible sequence. According to rumors, certain spy agencies monitor natural processes, such as the height of solar flares on the sun or the number of gamma rays emitted by decaying radioactive material per unit period of time, to develop a sequence of non-reproducible random numbers. These numbers are converted to a binary sequence for use as a key by equipment manufactured to encipher and decipher messages. Diskettes or tapes containing random binary sequences that serve as an enciphering and deciphering key are then prepared for use during different time periods and those disks are sent by courier to government locations where communications security (COMSEC) equipment that uses such disks is located. COMSEC personnel then load the appropriate disks at predefined times to change the keys, since the duplicate use of a binary key sequence would eliminate the reproducibility of the key and make the messages enciphered using a repeating key susceptible to decipherment by foreign governments monitoring communications.

The time, effort, and cost associated with developing true random number sequences and distributing those sequences for use normally restricts its use to government institutions. Commercial products that encipher messages and data files normally do so through the use of pseudo-random number sequences.


Previous Table of Contents Next


Learn Encryption Techniques with Basic and C++
Learn Encryption Techniques with BASIC and C++
ISBN: 1556225989
EAN: 2147483647
Year: 2005
Pages: 92
Authors: Gil Held

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net