Introduction To Cryptography
Introduction To Cryptography
Introduction To Cryptography
ChaptER
1
LEa R NI NG OUtCOMES
Introduction to
Cryptography
What is Ethics
3. Define cryptography;
7
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
INTRODUCTION
The widespread usage of computers and the Internet today has fostered new interest in
cryptography partly due to the new emphasis on personal privacy. In our pursuits to make
it easy for computers to share stuff, little did we realise that in essence our efforts
would also make it easy for other people to see all of our personal stuff too. In most
cases we naively expose far too much personal information, making it effortless for un-
familiar persons to read our personal email messages, credit card details, love letters
and so on. Visit the link below to view the describes the importance of cryptography.
Source: http://www.youtube.com/watch?v=HwW8ZChHqAc
Furthermore as the Internet continues to grow day by day making McLuhan’s global village,
a village where everyone can see what you do and hear what you say, a reality . . ., more
information is at an attacker’s disposal. The good news is that not all hope is lost as
those concerned with privacy can use cryptography to secure their networks from eaves-
droppers within this “global village”.
Not only can cryptographic methods scramble files, but they can also be used to prove
identity (and maybe even disprove it!). Cryptography today can be used to ensure integrity
and confidentiality of the contents of a file as it is able to signify modifications,
keep online communications safe, secure and ofcourse conceal important data. There are
several inexpensive cryptographic solutions available and the best part is their imple-
mentation is not complex and there-fore you do not need to be a rocket scientist to
incorporate crypto solutions into your network.
Before the 1970s, cryptography was a not considered as a cryptographic science, only a
few government and military personnel were privileged to understand its important role.
It is now a well-established academic discipline that is taught in many universities.
The history of cryptography has been illustrated in Figure 1.1.
8
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
It is also widely available for use by companies and individuals. There have been many
forces that have influenced this transition. Two of the most obvious have been the move
towards automated business and the establishment of the Internet as a communications
channel. Companies now want to trade with each other and with their customers using the
Internet. Governments want to communicate with their citizens via the Internet so that,
for example, tax returns may be submitted electronically.
9
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
Content 1
Without any doubt e-commerce is increasingly popular, but the lack of
adequate security is often quoted as being one of the main drawbacks for
its complete acceptance. Crypto-graphy initially focused on the problems
associated with confidential information, but in recent decades confiden-
tiality is frequently not the only main concern.
Content 2
Presuming that two people who are unable to see each other wish to communi-
cate using a public network, it would be a daunting task for either of them
to indisputably establish the identity to each other. Undoubtedly, for any
message being received via an open network, it is cardinal for the recipient
to be convinced that the sender’s identity is accurate.
Content 3
Not only this, but there is need for the message received to be identical to
that sent by the originator for confidence to be established between the two
parties. Furthermore, certain situations demand that the sender should not be
in a position to later deny sending the message and/or claim to have sent a
different one. Solutions to such important issues are certainly not clear-cut.
We cannot overstate the impact of the paper. Before this development, cryptography was
used to assure users that no modification would occur during the transmission of their
messages. However, this assumption relied on mutual trust between the communicating
parties.
This did not prove to be a problem at that time, because environments where crypto-
graphy could be employed were undoubtedly limited and basically the main users were
financial institutions, which at that time were not probably that globalised.
However, cryptography has significantly evolved over the last three decades. Not only have
10
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
there been a lot of technological advancements in this field, but there is now a large
variety of applications available. On the other hand, everyone is likely to be a direct
user or be affected by its use. Therefore, there is a need for all people to understand
how it works and what it can achieve.
The main idea of a cipher system is to hide confidential information in a way that
it cannot be understand to an unauthorised person. There are two different uses which
are, storing data securely in a file on a computer or transmitting data across an
insecure channel such as the Internet. Figure 1.2 is illustrates the cipher taxonomy.
Ciphers
Stream Block
In either circumstance the fact that the document is encrypted does not prevent
unauthorised people gaining access to it but, rather, ensures that they cannot
understood what they see.
11
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
The conversion of plaintext into an unreadable form achieved by the use of rules and the
assistance of keys can be regarded as a ‘magical formulae’.
Figure 1.3 provides a diagrammatic description of the use of a cipher system to protect a
transmitted message.
In general, what is known by the interceptor is the decryption algorithm, not the de-
cryption key. It is this lack of knowledge that is anticipated, prevents them from
knowing the plaintext.
It is very important to note that an attacker can gain access to plaintext by various
means of attack other than just by the use of cryptanalysis.
When encrypted data is stored on a laptop the owner will obviously require having some
way of recovering the decryption key. If for instance as is practiced in most cases the
owner decides to write down the key on a piece of paper which is then stuck to the lid
of their laptop, then anyone who access to the laptop automatically has the decryption
12
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
From this simple illustration, it is clear that the use of a good encryption algorithm
can easily be comprised if the security of the keys is not critically addressed.
The success of most cryptanalytic attacks involve the attacker trying to determine the
decryption key, which enables him to gain the same knowledge as the intended recipient
and to decrypt all other communications until the keys are changed. In some instances
though, an attacker may only be interested in intercepting a particular message.
Nevertheless when an attacker comes up with a practical way of determining the decryption
key it is considered as though an algorithm has been broken. In practice if the attacker
has sufficient information to recognise the correct key or more frequently to identify the
incorrect ones, then the algorithm may be broken. It is essential for the attacker to have
access to this additional information as it can help in guessing some of the variables.
Supposing the attacker knows the language that was used to construct the plaintext
and that the decryption of some ciphertext using a guessed key does not give meaning-
ful plaintext in the given language. This extra information will definitely disqualify
the guessed key.
13
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
Public key algorithms are discussed in later chapters. To shed more light on this
concept a well-known example is presented in Figure 1.5. It endeavours to show that
despite the fact that a present may be transmitted through a channel with many adver-
saries, safe delivery is feasible.
Figure 1.5: The steps to ensure the safely delivery of the present
As illustrated in Figure 1.5 we presume that the sender has a present, which he
wants to securely send to someone using a briefcase with a padlock. Due to some
justifiable reason the sender is not prepared to trust the recipient with his own key.
To avoid his key falling into untrusted hands the sender instructs the intended
recipient to purchase his own padlock and key. Here we are working under the
assumption that the padlocks and briefcase are sufficiently robust that no one
can forcibly remove the contents of the briefcase. Additionally, no one else
apart from the respective owners can find a key that can unlock both padlocks.
The sender and receiver now carry out the following steps to ensure delivery
14
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
Table 1.1: Steps to be Followed by Sender and Receiver to Ensure Delivery of the Present
Step 1 The sender places the present in a briefcase, which he locks with a padlock
and removes the key. He then sends the locked briefcase to the receiver.
Step 2 The receiver locks the briefcase with his padlock and removes the key.
He then returns it to the sender.
Note The briefcase is now locked with two padlocks so no one can get the
present.
Step 3 The sender removes his padlock from the briefcase using his own key
and thereafter returns the briefcase to the recipient.
Note Now the only lock on the briefcase belongs to the receiver.
Step 4 The recipient unlocks his padlock to obtain the present from the briefcase.
The result of this chain of events is that the recipient is now in possession of the
present, which has been delivered without either party needing to let their own keys
leave their possession. In this case, the necessity for trust between the two parties
is done away with. Of course in real world suppositions made about the keys and the
strength of the padlocks and briefcase are open to scrutiny.
However, when we discuss public key cryptography these assumptions are replaced by
mathematical equivalents, which are believed to be more acceptable. The concept of
secure communications without mutual trust might in theory be possible as illustrated
above.
When we endeavours to study the history of cryptography, there are algorithms that
we will find to be outdated and not really indicative of any modern cryptographic
techniques. However, it is very useful to study a number of early systems where en-
15
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
cryption was achieved by replacing each letter by another, called letter substitution,
and/or changing the order of the letters.
There are several motives behind this, the first one being their simplicity and ease
to understand examples which easily sheds more light on the basic concepts. Secondly,
they also help illustrate a number of potential weaknesses that exist in ciphers. Another
is that as they tend to be non-mathematical, no special scientific training is needed for
amateurs to enjoy trying them out.
As illustrated in Figure 1.6. One of the earliest examples of a cipher was the Caesar
Cipher used by Julius Caesar in the Gallic Wars. In this cipher, each of the letters
A to W is encrypted by being represented by the letter that will be in three places
after it in the alphabet. With a shift of 3, the letter A would be replaced by D, B
would become E, and so on. In effect, any shift is now generally viewed as a Caesar
Cipher since a shift can be achieved by using any number from 1 to 25.
Once again we use a diagram to illustrate a cipher. The Figure 1.7 represents two
concentric rings of which the outer one is free to rotate. If we start with the
letter A outside A, a shift of 2 results in C being outside A and so on. Including
the shift of 0 (which of course is the same as a shift of 26), there are now 26
settings. For a Caesar Cipher the encryption key and the decryption key are both
determined by a shift.
16
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
The Caesar Cipher is attained by assuming that each letter of the plaintext is on the
inner ring while the coinciding letters on the outer ring as the ciphertext which
depends on the selected shift. For decryption, we merely perform the reverse operation.
Thus, from the Figure 1.7, for a shift of 3 the ciphertext for the plaintext message
DOG is GRJ while the plaintext for a cryptogram FDW is CAT. In order to give the
reader confidence that they understand the system we list four statements to check.
If the shift is 7 then the ciphertext corresponding to VERY is CLYF while, for shift
17, the plaintext corresponding to JLE is SUN.
The encryption and decryption keys in the Caesar Cipher are both equal to the
shift however the encryption and decryption rules are different. By making minimal
adjustments in the formulation and making the two rules identical, it is possible
to obtain different encryption and decryption keys.
17
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
Due to the Caesar Cipher only having 26 keys, it is highly vulnerable to the
exhaustive key search attack. Apart from this, knowledge of a very small amount
of information like a single pair of corresponding plaintext and ciphertext
characters can enable the attacker to deduce the key.
If the originator had used a shift of 25 to create the ciphertext, then a shift
of 1 would be utilised for decryption giving YNAWI as the outcome. Since this
has no meaning in English we can safely eliminate 25 as the key value. The result
of systematically trying the keys 25 to 1, in decreasing order, is shown in the Table 1.2.
Table 1.2: An Example of an Exhaustive Key Search: Cryptogram XMZVH
With CREAM appearing as the most meaningful English word among the 26 probable
outcomes, we can then assume that the encryption key is 21. This enables us to
decrypt all future messages until the key is changed. As much as we have achieved
complete success in this key search, it is essential to note that when dealing with
a more complex cipher more than one key search will be required to yield the desired
result.
It is much more likely merely to limit the number of possibilities by eliminating some
obviously wrong ones. Going back to the Caesar Cipher example, you will notice that an
exhaustive key search for the ciphertext HSPPW produces two whole English words as
prob-able keys. (These shifts are 4 and 11, giving DOLLS and WHEEL respectively).
In such an instance, distinctively determining the key would require that the interceptor
18
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
be aware of the message’s context and additional variables from the cryptogram. Even
though we were not able to distinctively identify the key, we have managed to eliminate
24 keys. In the event that another cryptogram is intercepted, a full key search will not be
necessary as only the two deduced shift will be used.
From this illustration, I would like to bring to your attention that by using a shift
of 7 it is possible to find two English words with character lengths of five each.
During his reign, Caesar successfully eluded his enemies using a shift of 3 to left when
transmitting messages However with easy access to information today most people know
about encryption and thus the Caesar Cipher can effortlessly be broken.
When introducing the Caesar Cipher we noted that a shift of 26 is the same as a
shift of 0. This is because a shift of 26 is a complete revolution of the Caesar
Wheel. This reasoning can be extended to show that any shift is equivalent to a
shift between 0 and 25. For example a shift of 37 is obtained by one complete
revolution of the Caesar Wheel and then a shift of 11. Instead of saying, for
example, that a shift of 37 is equivalent to a shift of 11, we write 37 = 11 (mod 26).
This is known as using arithmetic modulo 26, and 26 is known as the modulus
as shown in Figure 1.8. Modular arithmetic, for many other module as well as
26, plays a crucial role in a number of cryptographic areas. Please refer to
the appendix for a fuller understanding of what is presented in this chapter.
19
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
Every now and then a Caesar Cipher is referred to as an additive cipher. This is
achieved by assigning numerical values to the alphabet as shown below:
A = 0, B=1, . .. , Z = 25.
Encryption for a Caesar Cipher with shift y can now be achieved by replacing
the number x by x + y (mod 26).
Thus, for example, since N is the fourteenth letter of the alphabet, N= 13.
To encrypt N with a shift of 15, we have x = 13, y = 15, which means the
encrypted version of N is 13 + 15 = 28 = 2 (mod 26). So N is encrypted
as C.
Since additive ciphers have few keys, multiplication as an optional encryption rule
may be used as a way to extend the number of keys. Encryption being a reversible
process, this may on the other hand limits the number of ‘multiplicative keys’.
Suppose we try to encrypt messages by multiplying by 2 and use arithmetic modulo 26.
When we do this A and N are both encrypted as A, B and O are both encrypted as C, etc.
This makes decryption impracticable as only alphabetical characters represented by even
numbers can appear in cipher text.
Furthermore, the cipher text may represent one of two letters. Worse still in
attempting to encrypt multiplying by 13, fifty percent of the alphabet would be
encrypted as A with the fifty percent as N. For multiplication to work the only
integers that can be used are: 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, or 25.
aCTIvITY
Can you create an application programming by C or Java to perform the
Cryptanalysis of Caesar Cipher?
20
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
Using this cipher will disprove the ‘grantee’ that a large number of keys is a sign
of strength. It also demonstrates how an interceptor can make the most of the statis-
tics of the underlying language. We illustrate this using the English alphabet as
shown below.
The order in which the letters are written dictates the encryption and decryption
keys which are equal. By replacing each letter by the one directly underneath it
the encryption rule is satisfied. When it comes to decryption the reverse applies.
For instance using the figure above as the key, the plaintext GET is will be encrypted
as ZTP and BIG as IYZ. Instead of randomly arranging the bold letters as above, a shift
can be used thus creating a Substitution cipher which in essence is a form of the Caesar
Cipher.
26 factorial, which is denoted as 26! is the number of keys for a Simple Substitution
Cipher. This is equivalent to the total number of ways in which the 26 letters of the
21
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
Attempting an exhaustive key search with such a huge number could prove to be a very
daunting task not only this but it also introduces new challenges such as key manage-
ment. In the first step we understand that, unlike the Caesar Cipher, the key is long
and difficult to memorise.
Thus, in pre-computer days, when this type of system was used manually, the key was
frequently written on a piece of paper. If this paper was seen and/or stolen then the
system was compromised. In the event that the key was lost, then the legitimate recip-
ient would have to discover a practical way of breaking the algorithm when in receipt
of further encrypted messages.
To address these challenges one scheme that can be used to generate keys is to come up
with a key phrase. Repeating characters should be removed before the key phrase can be
used as the starting point, then let the rest of the alphabetical characters follow in
a chronological order. The full key phrase is obtained by adding the remaining letters
in alphabetical order.
For example when a key phrase such as “We hope you enjoy this book”
is used, it will initially be represented as “wehopyunjtisbk” and
then the full key will be as follows.
“WEHOPYUNJTISBKACDFGLMQRVXZ“
Clearly restricting keys to those that can be derived from key phrases reduces the
number of keys because a significant proportion of the 26! Possible simple substi-
tution keys cannot be derived from an English phrase in this way. However, the
number of keys is still too large for an exhaustive search to be feasible and it
is now easy to remember keys.
22
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
of such keys. Since seven variables have been clearly identified, then if a further
1.5.3 Common Reasons for errors During setup
interception is made it is may not be necessary to be in possession of the entire key
to obtain the clear message.
In order to illustrate how the English language can be taken advantage of statistically,
we shall use four explicitly selected Simple Substitution cipher examples. The “bad guy”
in this case has the advantage of knowing that the plaintext is in English and it’s
encrypted using a Simple Substitution Cipher.
Example 1: G WR W RWL
The existence of only two one-letter words in English makes it easy to deduce
that either G represents A and W represents I or vice versa. It then follows
that G is unlikely to represent A and therefore the firmly results in the
message being I AM A MA. This leaves us with trying to figure out L. The way
English is structured limits the meaningful probable letters especially if we
assume that this message is a full sentence.
Example 2: HKC
Apart from the fact that this cipher text is written in the English language
there is not much to go on. However, when a process of elimination which is
dependent on the way that English is structured is carried out, we can firmly
disqualify keys that would simultaneously encrypt Z as H, Q as K, and K as C.
Needless to say we are still faced with a large number of probable keys making
the interception of this key almost immaterial. All in all this proves that a
three letter cryptogram which is encrypted using a Simple substitution may
securely be transmitted without fear of it being decrypted if intercepted.
Example 3: HATTPT
Assuming that this is a complete six letter word, then it definitely restricts
the probable number of plaintext that can meaningfully correspond to T because
of the way word endings are structured in English. Furthermore assuming that
T or P represents vowels, then all probable outcomes can be listed. We can
come up with words such as CHEESE, MISSES, and CANNON.
23
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
aCTIvITY
Can you create an application programming by C or Java to perform the
Cryptanalysis of simple substitution?
15, 511, 210, 043, 330, 985, 984, 000, 000 keys. Figure 1.10: Example of playfair cipher
24
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
For sake of clarity and better understanding a sixth row which the same as first row
and a sixth column which is the same as the first column is added to the 5 by 5 square.
This is shown in the diagram below.
1 If the two letters lie in the same row of the key then each letter is replaced
by the one on its right in the extended key.
2 If two letters lie in the same column of the key then each letter is replaced by the
one below it in the extended key.
If the two letters are not in the same row or column then the first letter is
3
replaced by the letter that is in the row of the first letter and the column
of the second letter. The second letter is replaced by the fourth corner of
the rectangle formed by the three letters used so far.
A quick look at this message shows that no Js are present so we move on to the next step
which allows to Zs appropriately. The following is what we get:
GO OD BR OZ OM SZ SW EZ EP CL EA NZ
Therefore, GO becomes FP; OD becomes UT; OM becomes PO. The complete cipher text is;
FP UT EC UW PO DV TV BV CM BG CS DY
A key phrase following the same procedure as with Simple Substitution Cipher is also
used in the construction of the Playfair Cipher. For instance using UNIVERSITY OF
LONDON as the key phrase after getting rid of repeated letters gives UNIVERSTYOFLD
and the key can be set out as shown in the next diagram.
25
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
The extension of the alphabet by introducing additional characters for the most
frequently used letters (A, E, N, O, R, T) of the English alphabet are represented
by more than one cipher text character is called Homophonic Coding. This cipher is
used to remove some of the weaknesses of the Simple Substitution Cipher.
In our illustration we use numerical randomising elements which are basically the
additional characters. This is shown in Figure 1.12.
Supposing the word TEETH is our plain text, we can then represent the two Es with
different cipher text characters. The cipher text would appear as 24 27 13 08 31.
This ought to confuse anyone who is not in possession of the key.
In this case, the two numbers representing E take up approximately 6 per cent of the
cryptogram. This clearly reduces the expected incidence of the letter E and flattens
the frequency histogram. In doing this the Homophonic coding reduces the chances for
a statistical attack.
26
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
Note 1
In order to differentiate between each character from the other, for instance
‘twelve’ and ‘one followed by two’, care must be taken when writing the cipher
text in this notation. Therefore the use of spacing between each variable is
very necessary.
Note 2
A few extra details are provided to help solve this cryptogram. These are;
2 The cipher text characters have been divided into groups of five characters.
3 This is to remove the chances of the attacker simply using reason to pick out
words based on their length like one letter words.
Unfortunately the key is not known making the task even more intimidating. (Those
with a “faint heart” are not obliged to try.)
27
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
28
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
Given more time and resources an interceptor may be able to compile a dictionary of
corresponding plaintext and ciphertext pairs for a given key. This is possible because
as much as some of the plaintext maybe represented by more than one ciphertext characters
and a good number of plaintext will uniquely correspond to one plaintext character. In
short even if the homophonic cipher is used to flatten the frequency histogram the risk
of an interceptor decrypting the ciphertext is still prominent.
In trying to reduce this risk, a polyalphabetic cipher is used as shown in Figure 1.13.
It improves upon the Homophonic cipher by varying the ciphertext character replacing a
particular plaintext letter within a cryptogram.
This variation may depend on the plaintext character’s location in the plaintext message
or the content of the plaintext that precedes it. Therefore, in this cipher identical
ciphertext characters may represent dissimilar plaintext letters which is not possible
with homophonic coding.
Once again we must point out that the simple examples of these ciphers that we describe
are no longer used. However, we discuss them in some detail so that we can then illustrate
a number of weaknesses that the modern algorithm designer has to avoid.
29
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
In the sixteenth century, a polyalphabetic substitution cipher called Vigenere Cipher was
put forward by Blaise de Vigenere. It is based on the following Table 1.3.
Note that each row of the table corresponds to a Caesar Cipher. The first row is a
shift of 0; the second is a shift of 1; and the last is a shift of 25.
The Vigenere cipher utilises the above table together with a keyword for encryption.
For example, to encrypt the message below:
30
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
Using RELATIONS as the keyword. Since the message is longer than the keyword, we have
to repeat the keyword several times in order for fit into the number of characters
contained in the message. Then derive the ciphertext using the tableau, for each letter
in the plaintext, one finds the intersection of the row given by the corresponding key-
word letter and the column given by the plaintext letter itself to pick out the cipher-
text letter.
This time keyword letters are used to pick a column of the table and then traced down
the column to the row containing the ciphertext letter. The index of that row is the
plaintext letter.
The strength of the Vigenere cipher against frequency analysis can be seen by examining
the above ciphertext. Note that there are 7 ‘T’s in the plaintext message and that they
have been encrypted by ‘H,’ ‘L,’ ‘K,’ ‘M,’ ‘G,’ ‘X,’ and ‘L’ respectively.
This successfully masks the frequency characteristics of the English ‘T.’ One way of
looking at this is to notice that each letter of our keyword RELATIONS picks out 1 of
the 26 possible substitution alphabets given in the Vigenere tableau. Thus, any message
encrypted by a Vigenere cipher is a collection of as many simple substitution ciphers
as there are letters in the keyword.
Even though the Vigenere cipher has all the features of a useful field cipher i.e.,
easily transportable key and tableau, requires no special apparatus, easy to apply,
etc., it did not catch on its day. A variation of it, known as the Gronsfeld Cipher,
did catch on in Germany and was widely used in Central Europe.
The Gronsfeld variant used the digits of a numerical key instead of letters of keyword,
but remained unchanged in all other respects. So, in fact the Gronsfeld is a weaker
31
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
technique than Vigenere since it only uses 10 substitute alphabets (one per digit 0..9)
instead of the 26 used by Vigenere.
aCTIvITY
Can you create an application programming by C or Java to perform the
Cryptanalysis of Vigenere Ciphers?
Using a short key whose length is five letters for encryption, we begin by
writing the key in rows of 5 letters followed by writing the letters of the first
column, then the second column and so on. Then add Zs at the end of plaintext,
in the event that total number of characters in the plaintext is not a multiple
of 5 (as is the case with the given example). Working through an example will
clarify the procedure more.
WHAT WAS THE WEATHER LIKE ON FRIDAY is the example message given.
In order to encrypt this message we start by splitting it into rows or five
letters each as shown below:
Since the last row only has four characters we therefore add a Z to give us the following:
32
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
WAWEEIHSERODATALNATHTIFYWEHKRZ
To obtain the decryption key we merely divide the length of the message by the key.
In this case we divide 30 by 5 to get 6. The deciphering algorithm is then identical
to encryption. So, for this example, we write the cryptogram in rows of 6 to get:
The fact that the key must be a divisor of the ciphertext length makes this cipher
system easy to break. Just by merely counting the number of characters in the crypto-
gram and then trying each divisor one after the other the interceptor can success-
fully break the cipher.
aCTIvITY
Can you create an application programming by C or Java to perform the
Cryptanalysis of Transposition Ciphers?
1.9 SUpER-ENCRYptION
As demonstrated in the previous sections of this chapter, the illustrated ciphers are
simple and can successfully be broken by a determined attacker. In order to deter even
a determined attacker super-encryption can be used. Super-encryption is the process of
combining two or more weak ciphers to obtain one that is significantly harder to break.
For instance if we wish to use Simple Substitution Cipher and a Transposition Cipher,
we begin by encrypting our plaintext with the Simple Substitution Cipher and then use
the outcome as input to encrypt using the Transposition Cipher.
33
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
SUMMaRY
3. The examples given in this chapter clearly indicate that successful decryption
of intercepted ciphertext can be measured by how the underlying language is
structured.
34
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
7. The key can be in form of a word, number or phrase. The same plaintext en-
crypts to different ciphertext with different keys.
9. One of the oldest known ciphers is called a transposition cipher. This type
of cipher changes the order of the letters of the original message. One method
is to write the message in a series of columns and rows in a grid or even
writing the message backwards.
GLOSSaRY
35
INtRODUCtION tO CRYptOGRaphY l ChaptER 1
REfERENCE
Alfred, J. Menezes, Paul, C. Van Oorschot, & Scott, A. Vanstone. (1996). Applied Cryp-
tography.
Fred Piper, & Sean Murphy. (2002). Cryptography: A Very Short Introduction. Oxford
University Press.
DISCUSSION QUEStIONS
3. How many keys are required for two people to communicate via a cipher?
10. What is the difference between a monoalphabetic cipher and a polyalphabetic cipher?
36
ChaptER 1 l INtRODUCtION tO CRYptOGRaphY
15. A ciphertext has been generated with an affine cipher. The most frequent letter
of the ciphertext is ‘B’ and the second most frequent letter of the ciphertext
is ‘U’. Break this code.
17. How many possible keys does the Playfair cipher have? Ignore the fact that some
keys might produce identical encryption results. Express your answer as an
approximate power of 2.
18. Using the Vigenere cipher, encrypt the word “explanation” using the key log.
37