HostedDB - Dedicated UNIX Servers

-->
Internet Security Professional Reference:Encryption Overview
Previous Table of Contents Next


Practice

Figure 10.10 shows an example of encrypting a message by using the ENCRYPT utility found on the CD accompanying this book. Figure 10.11 shows unencrypting it with monoalphabetic substitution.


Figure 10.10  Encrypting a monoalphabetic encryption message.


Figure 10.11  Decrypting a monoalphabetic encryption message.

Vigenere Encryption

With standard monoalphabetic encryption, the key to breaking the code is figuring out what each character stands for. Once done, the code is solved, for each character maintains its same meaning throughout the duration of the encryption. Vigenere encryption adds one more level of difficulty, in that the value of each character is different each time it is used.

The key to understanding the way this is done is knowing that Vigenere adds something to the equation none of the others have thus far: a key. The key is a word or phrase that is used to encrypt and decrypt the message. To understand the way this works, consider the following matrix:

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

When encrypting a character using this matrix, compare it with a matching character in the key, and find where the two correspond to ascertain the encryption character. Although it seems complicated, it is really very simple. Note the following example:

Key: OPPORTUNITY

Phrase: PUBLISHING

Result: DJQZZLBVVZ

Looking at the matrix, the O and P match up with a result of D. Likewise, P and U match up with a result of J, and so on, for the duration of the encryption. When the phrase to be encrypted is longer than the key—as is almost always the case—then the key repeats itself over and over. Thus, OPPORTUNITY really is OPPORTUNITYOPPORTUNITYOPPORTUNITY, and so on.

To decrypt the message, you must know the key that was used to create the encryption. Although not impossible, without this vital piece of information, it becomes extremely difficult to break the code.

The following example shows a phrase that has been used throughout this chapter encrypted with a key:

Key: OPPORTUNITY

Phrase: DIAL THE NUMBER OF THE NEW PARTY AND WAIT FOR AN ANSWER

Result: RXPZ1MBR(GSAQTF1HZ-BAC.CTK1IUEBR8OCS.NTCG(YMF/PB1THFEXP

Notice that in the complete version of the matrix, spaces and other punctuation are also included. The following shows three attempts to decrypt the message without knowing the correct key:

Attempt One

Key: CONSIDER

Phrase: RXPZ1MBR(GSAQTF1HZ-BAC.CTK1IUEBR8OCS.NTCG(YMF/PB1THFEXP

Result: PJCHCJXA&SFIIQB FL JSZDLRW$QMBXAPAPA&KPLE_LUXFLKIFUNWUL

Attempt Two

Key: ORANGEBOOK

Phrase: RXPZ1MBR(GSAQTF1HZ-BAC.CTK1IUEBR8OCS.NTCG(YMF/PB1THFEXP

Result: DGPMEIAD_WEJQGZGGLRMLHPNGJUGUNARBWOGZFSS_YZZEON#JTOEKJ

Attempt Three

Key: OPPORTUNITIES

Phrase: RXPZ1MBR(GSAQTF1HZ-BAC.CTK1IUEBR8OCS.NTCG(YMF/PBLDNQIAP

Result: DIAL THE NKWYFQ”TI_HNU_UPS#TFQKY$BUZ&JBOR_KVM_CT

Notice the previous example. Although the guess to the key’s identity is very close, the result is accurate only to the extent of the accuracy in the first occurrence of the guess. Nowhere else in the phrase are the correct characters decrypted, even though the guess is extremely close.

Figures 10.12 and 10.13 show examples of using the ENCRYPT utility to encrypt and then decrypt a message.


Figure 10.12  Encrypting a message with Vigenere encryption.


Figure 10.13  Decrypting a message with Vigenere encryption.

To make the message even more secure, encrypt the same message a number of times, using a different key each time, as illustrated in the following. Each of the keys here are coming from portions of newspaper headlines, making it easy for others to use the same keys.

Key:    SAVE OUR SOFTWARE
Phrase: TRUCKS AND VEHICLES WITH TRAILERS USE RIGHT LANE
Result: LRPG*G4R-V.AXDITPWS5A(HB13JONEARJ$MSZ$1WAY32ZFGA
Key:    MOB ACTIVITY
Phrase: LRPG*G4R-V.AXDITPWS5A(HB13JONEARJ$MSZ$1WAY32ZFGA
Result: XFQ&*IGZBDAYJRJ3PYL=V0AZ=AK.NGTZE,FQL226AAF:UNZY
Key:    SOCIAL PROBLEMS
Phrase: XFQ&*IGZBDAYJRJ3PYL=V0AZ=AK.NGTZE,FQL226AAF:UNZY
Result: PTS.*T&OSRBJNDBEDAT=G_PQKBV2ZYLNG4FB+ACDBLJFMFNA

To take the final result back to the original message, someone trying to break the code must now decrypt it three times knowing three sets of keys. This is a very difficult task, indeed.


Previous Table of Contents Next