Topic: Cryptology: History of Cryptography
Topic: Cryptology: History of Cryptography
Origins of Cryptography:
Human being from ages had two inherent needs − (a) to communicate and share
information and (b) to communicate selectively. These two needs gave rise to the art of
coding the messages in such a way that only the intended people could have access to
the information. Unauthorized people could not extract any information, even if the
scrambled messages fell in their hand.
The art and science of concealing the messages to introduce secrecy in information
security is recognized as cryptography.
The word ‘cryptography’ was coined by combining two Greek words, ‘Krypto’ meaning
hidden and ‘graphene’ meaning writing.
History of Cryptography
The art of cryptography is considered to be born along with the art of writing. As
civilizations evolved, human beings got organized in tribes, groups, and kingdoms. This
led to the emergence of ideas such as power, battles, supremacy, and politics. These
ideas further fueled the natural need of people to communicate secretly with selective
recipient which in turn ensured the continuous evolution of cryptography as well.
The roots of cryptography are found in Roman and Egyptian civilizations.
Hieroglyph − The Oldest Cryptographic Technique
The first known evidence of cryptography can be traced to the use of ‘hieroglyph’. Some
4000 years ago, the Egyptians used to communicate by messages written in hieroglyph.
This code was the secret known only to the scribes who used to transmit messages on
behalf of the kings. One such hieroglyph is shown below.
Later, the scholars moved on to using simple mono-alphabetic substitution ciphers during
500 to 600 BC. This involved replacing alphabets of message with other alphabets with
some secret rule. This rule became a key to retrieve the message back from the garbled
message.
The earlier Roman method of cryptography, popularly known as the Caesar Shift
Cipher, relies on shifting the letters of a message by an agreed number (three was a
common choice), the recipient of this message would then shift the letters back by the
same number and obtain the original message.
.
Steganography
Evolution of Cryptography
It is during and after the European Renaissance, various Italian and Papal states led the
rapid proliferation of cryptographic techniques. Various analysis and attack techniques
were researched in this era to break the secret codes.
Improved coding techniques such as Vigenere Coding came into existence in the
15th century, which offered moving letters in the message with a number of variable
places instead of moving them the same number of places.
Only after the 19th century, cryptography evolved from the ad hoc approaches to
encryption to the more sophisticated art and science of information security.
In the early 20th century, the invention of mechanical and electromechanical
machines, such as the Enigma rotor machine, provided more advanced and
efficient means of coding the information.
During the period of World War II, both cryptography and cryptanalysis became
excessively mathematical.
With the advances taking place in this field, government organizations, military units, and
some corporate houses started adopting the applications of cryptography. They used
cryptography to guard their secrets from others. Now, the arrival of computers and the
Internet has brought effective cryptography within the reach of common people.
Modern Cryptography:
Modern cryptography is the cornerstone of computer and communications security. Its
foundation is based on various concepts of mathematics such as number theory,
computational-complexity theory, and probability theory.
Context of Cryptography
Cryptology, the study of cryptosystems, can be subdivided into two branches −
Cryptography
Cryptanalysis
What is Cryptography?
Cryptography is the art and science of making a cryptosystem that is capable of providing
information security.
Cryptography deals with the actual securing of digital data. It refers to the design of
mechanisms based on mathematical algorithms that provide fundamental information
security services. You can think of cryptography as the establishment of a large toolkit
containing different techniques in security applications.
What is Cryptanalysis?
The art and science of breaking the cipher text is known as cryptanalysis.
Cryptanalysis is the sister branch of cryptography and they both co-exist. The
cryptographic process results in the cipher text for transmission or storage. It involves the
study of cryptographic mechanism with the intention to break them. Cryptanalysis is also
used during the design of the new cryptographic techniques to test their security
strengths.
Note − Cryptography concerns with the design of cryptosystems, while cryptanalysis
studies the breaking of cryptosystems.
Security Services of Cryptography
The primary objective of using cryptography is to provide the following four fundamental
information security services. Let us now see the possible goals intended to be fulfilled
by cryptography.
Confidentiality
Confidentiality is the fundamental security service provided by cryptography. It is a
security service that keeps the information from an unauthorized person. It is sometimes
referred to as privacy or secrecy.
Confidentiality can be achieved through numerous means starting from physical securing
to the use of mathematical algorithms for data encryption.
Data Integrity
It is security service that deals with identifying any alteration to the data. The data may
get modified by an unauthorized entity intentionally or accidently. Integrity service
confirms that whether data is intact or not since it was last created, transmitted, or stored
by an authorized user.
Data integrity cannot prevent the alteration of data, but provides a means for detecting
whether data has been manipulated in an unauthorized manner.
Authentication
Authentication provides the identification of the originator. It confirms to the receiver that
the data received has been sent only by an identified and verified sender.
Authentication service has two variants −
Message authentication identifies the originator of the message without any
regard router or system that has sent the message.
Entity authentication is assurance that data has been received from a specific
entity, say a particular website.
Apart from the originator, authentication may also provide assurance about other
parameters related to data such as the date and time of creation/transmission.
Non-repudiation
It is a security service that ensures that an entity cannot refuse the ownership of a
previous commitment or an action. It is an assurance that the original creator of the data
cannot deny the creation or transmission of the said data to a recipient or third party.
Non-repudiation is a property that is most desirable in situations where there are chances
of a dispute over the exchange of data. For example, once an order is placed
electronically, a purchaser cannot deny the purchase order, if non-repudiation service
was enabled in this transaction.
Cryptography Primitives
Cryptography primitives are nothing but the tools and techniques in Cryptography that
can be selectively used to provide a set of desired security services −
Encryption
Hash functions
Message Authentication codes (MAC)
Digital Signatures
The following table shows the primitives that can achieve a particular security service on
their own.
Note − Cryptographic primitives are intricately related and they are often combined to
achieve a set of desired security services from a cryptosystem
Cryptosystem:
A cryptosystem is an implementation of cryptographic techniques and their
accompanying infrastructure to provide information security services. A cryptosystem is
also referred to as a cipher system.
Let us discuss a si.commple model of a cryptosystem that provides confidentiality to the
information being transmitted. This basic model is depicted in the illustration below −
The illustration shows a sender who wants to transfer some sensitive data to a receiver
in such a way that any party intercepting or eavesdropping on the communication channel
cannot extract the data.
The objective of this simple cryptosystem is that at the end of the process, only the sender
and the receiver will know the plaintext.
Components of a Cryptosystem
The various components of a basic cryptosystem are as follows −
Plaintext. It is the data to be protected during transmission.
Encryption Algorithm. It is a mathematical process that produces a ciphertext for
any given plaintext and encryption key. It is a cryptographic algorithm that takes
plaintext and an encryption key as input and produces a ciphertext.
Ciphertext. It is the scrambled version of the plaintext produced by the encryption
algorithm using a specific the encryption key. The ciphertext is not guarded. It
flows on public channel. It can be intercepted or compromised by anyone who has
access to the communication channel.
Decryption Algorithm, It is a mathematical process, that produces a unique
plaintext for any given ciphertext and decryption key. It is a cryptographic
algorithm that takes a ciphertext and a decryption key as input, and outputs a
plaintext. The decryption algorithm essentially reverses the encryption algorithm
and is thus closely related to it.
Encryption Key. It is a value that is known to the sender. The sender inputs the
encryption key into the encryption algorithm along with the plaintext in order to
compute the ciphertext.
Decryption Key. It is a value that is known to the receiver. The decryption key is
related to the encryption key, but is not always identical to it. The receiver inputs
the decryption key into the decryption algorithm along with the ciphertext in order
to compute the plaintext.
For a given cryptosystem, a collection of all possible decryption keys is called a key
space.
An interceptor (an attacker) is an unauthorized entity who attempts to determine the
plaintext. He can see the ciphertext and may know the decryption algorithm. He,
however, must never know the decryption key.
Types of Cryptosystems
Fundamentally, there are two types of cryptosystems based on the manner in which
encryption-decryption is carried out in the system −
Asymmetric Key Encryption was invented in the 20th century to come over the necessity
of pre-shared secret key between communicating persons. The salient features of this
encryption scheme are as follows −
Every user in this system needs to have a pair of dissimilar keys, private key and
public key. These keys are mathematically related − when one key is used for
encryption, the other can decrypt the ciphertext back to the original plaintext.
It requires to put the public key in public repository and the private key as a well-
guarded secret. Hence, this scheme of encryption is also called Public Key
Encryption.
Though public and private keys of the user are related, it is computationally not
feasible to find one from another. This is a strength of this scheme.
When Host1 needs to send data to Host2, he obtains the public key of Host2 from
repository, encrypts the data, and transmits.
Host2 uses his private key to extract the plaintext.
Length of Keys (number of bits) in this encryption is large and hence, the process
of encryption-decryption is slower than symmetric key encryption.
Processing power of computer system required to run asymmetric algorithm is
higher.
Symmetric cryptosystems are a natural concept. In contrast, public-key cryptosystems
are quite difficult to comprehend.
You may think, how can the encryption key and the decryption key are ‘related’, and yet
it is impossible to determine the decryption key from the encryption key? The answer lies
in the mathematical concepts. It is possible to design a cryptosystem whose keys have
this property. The concept of public-key cryptography is relatively new. There are fewer
public-key algorithms known than symmetric algorithms.
Challenge of Public Key Cryptosystem
Public-key cryptosystems have one significant challenge − the user needs to trust that
the public key that he is using in communications with a person really is the public key of
that person and has not been spoofed by a malicious third party.
This is usually accomplished through a Public Key Infrastructure (PKI) consisting a
trusted third party. The third party securely manages and attests to the authenticity of
public keys. When the third party is requested to provide the public key for any
communicating person X, they are trusted to provide the correct public key.
The third party satisfies itself about user identity by the process of attestation,
notarization, or some other process − that X is the one and only, or globally unique, X.
The most common method of making the verified public keys available is to embed them
in a certificate which is digitally signed by the trusted third party.
Due to the advantages and disadvantage of both the systems, symmetric key and public-
key cryptosystems are often used together in the practical information security systems.
Attacks in Cryptology:
In the present era, not only business but almost all the aspects of human life are driven
by information. Hence, it has become imperative to protect useful information from
malicious activities such as attacks. Let us consider the types of attacks to which
information is typically subjected to.
Attacks are typically categorized based on the action performed by the attacker. An
attack, thus, can be passive or active.
Passive Attacks
The main goal of a passive attack is to obtain unauthorized access to the information.
For example, actions such as intercepting and eavesdropping on the communication
channel can be regarded as passive attack.
These actions are passive in nature, as they neither affect information nor disrupt the
communication channel. A passive attack is often seen as stealing information. The only
difference in stealing physical goods and stealing information is that theft of data still
leaves the owner in possession of that data. Passive information attack is thus more
dangerous than stealing of goods, as information theft may go unnoticed by the owner.
Active Attacks
An active attack involves changing the information in some way by conducting some
process on the information. For example,
Modifying the information in an unauthorized manner.
Initiating unintended or unauthorized transmission of information.
Alteration of authentication data such as originator name or timestamp associated
with information
Unauthorized deletion of data.
Denial of access to information for legitimate users (denial of service).
Cryptography provides many tools and techniques for implementing cryptosystems
capable of preventing most of the attacks described above.
Assumptions of Attacker
Let us see the prevailing environment around cryptosystems followed by the types of
attacks employed to break these systems −
Environment around Cryptosystem
While considering possible attacks on the cryptosystem, it is necessary to know the
cryptosystems environment. The attacker’s assumptions and knowledge about the
environment decides his capabilities.
In cryptography, the following three assumptions are made about the security
environment and attacker’s capabilities.
Details of the Encryption Scheme
The design of a cryptosystem is based on the following two cryptography algorithms −
Public Algorithms − With this option, all the details of the algorithm are in the
public domain, known to everyone.
Proprietary algorithms − The details of the algorithm are only known by the
system designers and users.
In case of proprietary algorithms, security is ensured through obscurity. Private
algorithms may not be the strongest algorithms as they are developed in-house and may
not be extensively investigated for weakness.
Secondly, they allow communication among closed group only. Hence they are not
suitable for modern communication where people communicate with large number of
known or unknown entities. Also, according to Kerckhoff’s principle, the algorithm is
preferred to be public with strength of encryption lying in the key.
Thus, the first assumption about security environment is that the encryption algorithm
is known to the attacker.
Availability of Ciphertext
We know that once the plaintext is encrypted into ciphertext, it is put on unsecure public
channel (say email) for transmission. Thus, the attacker can obviously assume that it has
access to the ciphertext generated by the cryptosystem.
Availability of Plaintext and Ciphertext
This assumption is not as obvious as other. However, there may be situations where an
attacker can have access to plaintext and corresponding ciphertext. Some such
possible circumstances are −
The attacker influences the sender to convert plaintext of his choice and obtains
the ciphertext.
The receiver may divulge the plaintext to the attacker inadvertently. The attacker
has access to corresponding ciphertext gathered from open channel.
In a public-key cryptosystem, the encryption key is in open domain and is known
to any potential attacker. Using this key, he can generate pairs of corresponding
plaintexts and ciphertexts.
Cryptographic Attacks
The basic intention of an attacker is to break a cryptosystem and to find the plaintext from
the ciphertext. To obtain the plaintext, the attacker only needs to find out the secret
decryption key, as the algorithm is already in public domain.
Hence, he applies maximum effort towards finding out the secret key used in the
cryptosystem. Once the attacker is able to determine the key, the attacked system is
considered as broken or compromised.
Based on the methodology used, attacks on cryptosystems are categorized as follows −
Ciphertext Only Attacks (COA) − In this method, the attacker has access to a
set of ciphertext(s). He does not have access to corresponding plaintext. COA is
said to be successful when the corresponding plaintext can be determined from a
given set of ciphertext. Occasionally, the encryption key can be determined from
this attack. Modern cryptosystems are guarded against ciphertext-only attacks.
Known Plaintext Attack (KPA) − In this method, the attacker knows the plaintext
for some parts of the ciphertext. The task is to decrypt the rest of the ciphertext
using this information. This may be done by determining the key or via some other
method. The best example of this attack is linear cryptanalysis against block
ciphers.
Chosen Plaintext Attack (CPA) − In this method, the attacker has the text of his
choice encrypted. So he has the ciphertext-plaintext pair of his choice. This
simplifies his task of determining the encryption key. An example of this attack is
differential cryptanalysis applied against block ciphers as well as hash functions.
A popular public key cryptosystem, RSA is also vulnerable to chosen-plaintext
attacks.
Dictionary Attack − This attack has many variants, all of which involve compiling
a ‘dictionary’. In simplest method of this attack, attacker builds a dictionary of
ciphertexts and corresponding plaintexts that he has learnt over a period of time.
In future, when an attacker gets the ciphertext, he refers the dictionary to find the
corresponding plaintext.
Brute Force Attack (BFA) − In this method, the attacker tries to determine the
key by attempting all possible keys. If the key is 8 bits long, then the number of
possible keys is 28 = 256. The attacker knows the ciphertext and the algorithm,
now he attempts all the 256 keys one by one for decryption. The time to complete
the attack would be very high if the key is long.
Man in Middle Attack (MIM) − The targets of this attack are mostly public key
cryptosystems where key exchange is involved before communication takes
place.
o Host A wants to communicate to host B, hence requests public key of B.
o An attacker intercepts this request and sends his public key instead.
Practicality of Attacks
The attacks on cryptosystems described here are highly academic, as majority of them
come from the academic community. In fact, many academic attacks involve quite
unrealistic assumptions about environment as well as the capabilities of the attacker. For
example, in chosen-ciphertext attack, the attacker requires an impractical number of
deliberately chosen plaintext-ciphertext pairs. It may not be practical altogether.
Nonetheless, the fact that any attack exists should be a cause of concern, particularly if
the attack technique has the potential for improvement.
Cryptology Techniques
In the second chapter, we discussed the fundamentals of modern cryptography. We
equated cryptography with a toolkit where various cryptographic techniques are
considered as the basic tools. One of these tools is the Symmetric Key Encryption
where the key used for encryption and decryption is the same.
In this chapter, we discuss this technique further and its applications to develop
various cryptosystems.
Caesar Cipher
It is a mono-alphabetic cipher wherein each letter of the plaintext is substituted by
another letter to form the ciphertext. It is a simplest form of substitution cipher
scheme.
For this type of scheme, both sender and receiver agree on a ‘secret shift number’
for shifting the alphabet. This number which is between 0 and 25 becomes the key of
encryption.
The name ‘Caesar Cipher’ is occasionally used to describe the Shift Cipher when the
‘shift of three’ is used.
Security Value
Caesar Cipher is not a secure cryptosystem because there are only 26 possible
keys to try out. An attacker can carry out an exhaustive key search with available
limited computing resources.
For example, A.B…..Y.Z and Z.Y……B.A are two obvious permutation of all the
letters in alphabet. Permutation is nothing but a jumbled up set of alphabets.
With 26 letters in alphabet, the possible permutations are 26! (Factorial of 26) which
is equal to 4x1026. The sender and the receiver may choose any one of these
possible permutation as a ciphertext alphabet. This permutation is the secret key of
the scheme.
Here is a jumbled Ciphertext alphabet, where the order of the ciphertext letters is a
key.
On receiving the ciphertext, the receiver, who also knows the randomly
chosen permutation, replaces each ciphertext letter on the bottom row with
the corresponding plaintext letter in the top row. The ciphertext ‘MJBXZ’ is
decrypted to ‘point’.
Security Value
All of the substitution ciphers we have discussed earlier in this chapter are
monoalphabetic; these ciphers are highly susceptible to cryptanalysis.
Polyalphabetic Cipher is a substitution cipher in which the cipher alphabet for the
plain alphabet may be different at different places during the encryption process. The
next two examples, playfair and Vigenere Cipher are polyalphabetic ciphers.
Playfair Cipher
In this scheme, pairs of letters are encrypted, instead of single letters as in the case
of simple substitution cipher.
In playfair cipher, initially a key table is created. The key table is a 5×5 grid of
alphabets that acts as the key for encrypting the plaintext. Each of the 25 alphabets
must be unique and one letter of the alphabet (usually J) is omitted from the table as
we need only 25 alphabets instead of 26. If the plaintext contains J, then it is
replaced by I.
The sender and the receiver deicide on a particular key, say ‘tutorials’. In a key table,
the first characters (going left to right) in the table is the phrase, excluding the
duplicate letters. The rest of the table will be filled with the remaining letters of the
alphabet, in natural order. The key table works out to be −
Process of Playfair Cipher
First, a plaintext message is split into pairs of two letters (digraphs). If there is
an odd number of letters, a Z is added to the last letter. Let us say we want to
encrypt the message “hide money”. It will be written as −
HI DE MO NE YZ
AL SBC
D E F G H ‘H’ and ‘I’ are in same column, hence take letter below them to replace. HI → QC
KM NPQ
V WX Y Z
If both letters are in the same row, take the letter to the right of each one
(going back to the left if at the farthest right)
T U OR I
AL SB C
‘D’ and ‘E’ are in same row, hence take letter to the right of them to replace. DE
DE F GH
→ EF
KMNP Q
V WX Y Z
If neither of the preceding two rules are true, form a rectangle with the two
letters and take the letters on the horizontal opposite corner of the rectangle.
Using these rules, the result of the encryption of ‘hide money’ with the key of
‘tutorials’ would be −
QC EF NU MF ZV
Decrypting the Playfair cipher is as simple as doing the same process in reverse.
Receiver has the same key and can create the same key table, and then decrypt any
messages made using that key.
Security Value
The Playfair cipher was used mainly to protect important, yet non-critical secrets, as
it is quick to use and requires no special equipment.
Vigenere Cipher
This scheme of cipher uses a text string (say, a word) as a key, which is then used
for doing a number of shifts on the plaintext.
For example, let’s assume the key is ‘point’. Each alphabet of the key is converted to
its respective numeric value: In this case,
He now shifts each plaintext alphabet by the number written below it to create
ciphertext as shown below −
Here, each plaintext character has been shifted by a different amount – and
that amount is determined by the key. The key must be less than or equal to
the size of the message.
For decryption, the receiver uses the same key and shifts received ciphertext
in reverse order to obtain the plaintext.
Security Value
Vigenere Cipher was designed by tweaking the standard Caesar cipher to reduce
the effectiveness of cryptanalysis on the ciphertext and make a cryptosystem more
robust. It is significantly more secure than a regular Caesar Cipher.
In the history, it was regularly used for protecting sensitive political and military
information. It was referred to as the unbreakable cipher due to the difficulty it
posed to the cryptanalysis.
The keyword length is same as plain text message. This case is called
Vernam Cipher. It is more secure than typical Vigenere cipher.
Vigenere cipher becomes a cryptosystem with perfect secrecy, which is called
One-time pad.
One-Time Pad
The circumstances are −
In case of Shift cipher, the entire message could have had a shift between 1 and 25.
This is a very small size, and very easy to brute force. However, with each character
now having its own individual shift between 1 and 26, the possible keys grow
exponentially for the message.
Let us say, we encrypt the name “point” with a one-time pad. It is a 5 letter text. To
break the ciphertext by brute force, you need to try all possibilities of keys and
conduct computation for (26 x 26 x 26 x 26 x 26) = 265 = 11881376 times. That’s for
a message with 5 alphabets. Thus, for a longer message, the computation grows
exponentially with every additional alphabet. This makes it computationally
impossible to break the ciphertext by brute force.
Substitution Technique:
1- Substitution Cipher
C=(p+k)mod26
Theorem:
1<( less then equal to) k< (less then equal to) 26