CS19642-Cryptography and Network Security
UNIT 1 NETWORK SECURITY MODEL AND CLASSICAL ENCRYPTION TECHNIQUES
SESSION 2
Model for Network Security
2
Model for Network Security
Message is to be transferred from one party to another across some sort of Internet
service.
The two parties, who are the principals in this transaction, must cooperate for the
exchange to take place.
A logical information channel is established by defining a route through the
Internet from source to destination and by the cooperative use of communication
protocols (e.g., TCP/IP) by the two principals.
Security aspects come into play when it is necessary or desirable to protect the
information transmission from an opponent who may present a threat to
confidentiality, authenticity, and so on.
3
Model for Network Security
Providing security have three components
A security-related transformation on the information to be sent. Examples include
the encryption of the message, which scrambles the message so that it is
unreadable by the opponent, and the addition of a code based on the contents of
the message, which can be used to verify the identity of the sender.
Some secret information shared by the two principals and, it is hoped, unknown to
the opponent. An example is an encryption key used in conjunction with the
transformation to scramble the message before transmission and unscramble it on
reception.
A trusted third party may be needed to achieve secure transmission. For example,
a third party may be responsible for distributing the secret information to the two
principals while keeping it from any opponent (authenticity of a message
transmission)
4
Model for Network Security
The attackers who attack the system fall in to 2 categories:
Hacker : can be someone who, with no malign intent, simply gets satisfaction from
breaking and entering a computer system.
Intruder : can be a disgruntled employee who wishes to do damage or a criminal
who seeks to exploit computer assets for financial gain (e.g., obtaining credit card
numbers or perform ing illegal money transfers).
5
Model for Network Security
This general model shows that there are four basic tasks in designing a particular
security service:
1. Design an algorithm for performing the security-related transformation. The
algorithm should be such that an opponent cannot defeat its purpose.
2. Generate the secret information to be used with the algorithm Key
3. Develop methods for the distribution and sharing of the secret information.
4. Specify a protocol to be used by the two principals that makes use of the
security algorithm and the secret information to achieve a particular security
service.
6
Model for Network Security
Another type of unwanted access is the placement in a computer system of
logic that exploits vulnerabilities in the system and that can affect
application programs as well as utility programs, such as editors and
compilers.
Information access threats: Intercept or modify data on behalf of users who
should not have access to that data.
Service threats: Exploit service flaws in computers to inhibit use by
legitimate users. 7
Model for Network Security
Viruses and worms are two examples of software attacks. Such attacks can be
introduced into a system by means of a disk that contains the unwanted logic
concealed in otherwise useful software. They can also be inserted into a system
across a network.
The security mechanisms needed to cope with unwanted access fall into two
broad categories
The first category might be termed a gatekeeper function. It includes password-
based login procedures that are designed to deny access to all but authorized users
and screening logic that is designed to detect and reject worms, viruses, and other
similar attacks.
Once either an unwanted user or unwanted software gains access, the second line
of defense consists of a variety of internal controls that monitor activity and
analyze stored information in an attempt to detect the presence of unwanted
intruders.
8
CRYPTOGRAPHY
Computer Security:
• The protection afforded to an automated information system in order to attain the
applicable objectives of preserving the Integrity, Availability, and Confidentiality
of information system resources.
• This definition of computer security introduces three key objectives that are at the
heart of computer security:
• [Link]: It covers two concepts
• Data Confidentiality: Assures that private or confidential information is not made
available or disclosed to unauthorized individuals.
• Privacy: Assures that individuals control or influence what information related to
them may be collected and stored and by whom and to whom that information
may be disclosed.
9
CRYPTOGRAPHY
[Link]: It covers two concepts
Data Integrity: Assures that information and programs are changed only in specified
and authorize manner.
System Integrity: Assures that a system performs its intended function in an
unimpaired manner, free from deliberate or inadvertent unauthorized manipulation
of the system.
[Link]: Assures that systems work promptly and service is not denied to
authorize user.
•Threat: A potential for violation of security, which exists when there is a
circumstance, capability, action, or event that could breach security and cause harm.
That is, a threat is a possible danger that might exploit vulnerability.
10
CRYPTOGRAPHY
An original message is known as the plaintext.
The Coded message is called the ciphertext.
The Process of converting from plaintext to ciphertext is known as enciphering or
encryption.
Restoring the plaintext from the ciphetext is deciphering or decryption.
The many schemes used for encryption constitute the area of study known as
cryptography.
Techniques used for deciphering a message without any knowledge of the
enciphering details is known as cryptanalysis. It also known as "Breaking the
Code". The areas of cryptography and cryptanalysis together are called cryptology.
A cryptanalyst develops mathematical methods and codes that protect data from
computer hackers. This involves the decryption of a cipher text into plain text in
order to transmit a message over insecure channels.
11
CRYPTOGRAPHY
Symmetric encryption also referred to as conventional encryption or single-key
encryption. Here, the sender and recipient share a common key.
12
A symmetric encryption scheme has five ingredients
1) Plaintext: This is the original intelligible message or data that is fed into the
algorithm asinput.
2) Encryption algorithm: The encryption algorithm performs various substitutions
and transformations on the plaintext.
3) Secret key: The secret key is also input to the encryption algorithm. The key is a
value independent of the plaintext and of the algorithm. The algorithm will produce
a different output depending on the specific key being used at the time. The exact
substitutions and transformations performed by the algorithm depend on the key.
4) Cipher text: This is the scrambled message produced as output. It depends on the
plaintext and the secret key. For a given message, two different keys will produce
two different cipher texts. The cipher text is an apparently random stream of data
and, as it stands, is unintelligible.
5) Decryption algorithm: This is essentially the encryption algorithm run in reverse.
It takes the cipher text and the secret key and produces the original plaintext.
13
CRYPTOGRAPHY
There are two requirements for secure use of conventional encryption:
1. We need a strong encryption algorithm.
2. Sender and receiver must have obtained copies of the secret key in a secure
fashion and must keep the key secure.
It is impractical to decrypt a message on the basis of the cipher text plus
knowledge of the encryption/decryption algorithm. In other words, we do not need
to keep the algorithm secret; we need to keep only the key secret.
14
Model of symmetric cryptosystem:
A source produces a message in plaintext: X = [X1, X2,..., XM].
M- elements of X letters.
For encryption, a key of the form: K = [K1, K2, …, KJ] is generated.
If the key is generated at the message source, then it must also be provided to the
destination by means of some secure channel.
Alternatively, a third party could generate the key and securely deliver it to both
source and destination.
With the message X and the encryption key K as input, the encryption algorithm
forms the cipher text Y = [Y1, Y2,…, YN].
Y =E(K, X) Where,Y- cipher text ,E- Encryption algorithm K- Key , X-Plain
text .
At the receiver side the transformation: X = D(K, Y)
Y- cipher text ,D-Decryption algorithm K- Key , X- Plain text
15
Cryptographic systems are generally classified along 3 independent
dimensions:
1) Type of operations used for transforming plain text to cipher text
All the encryption algorithms are based on two general principles:
➢ Substitution, in which each element in the plaintext is mapped into another element
➢ Transposition, in which elements in the plaintext are rearranged.
2) The number of keys used
➢ If the sender and receiver uses same key then it is said to be symmetric key (or) single key
(or) conventional encryption.
➢ If the sender and receiver use different keys then it is said to be public key encryption.
3) The way in which the plain text is processed
• ➢ A block cipher processes the input and block of elements at a time, producing output
block for each input block.
• ➢ A stream cipher processes the input elements continuously, producing output element one
at a time, as it goes along.
16
CRYPTANALYSIS AND BRUTE-FORCE ATTACK
• There are two general approaches to attacking a conventional encryption scheme:
Cryptanalysis: Cryptanalytic attacks rely on the nature of the algorithm and some
knowledge of the general characteristics of the plaintext or even some sample
plaintext–cipher text pairs.
Classification of attacks:
a) Classical Cryptanalysis
- Brute force attack
- Analytical attack
b) Social Engineering
c) Implementation attacks
Brute-force attack: The attacker tries every possible key on a piece of cipher text
until an intelligible translation into plaintext is obtained.
17
Encryption algorithms are to be
➢ Unconditionally secure
An encryption scheme is unconditionally secure if the cipher text generated by the
scheme does not contain enough information to determine uniquely the
corresponding plaintext.
➢ Computationally secure
An encryption scheme is said to be computationally secure, if
If the cost of breaking the cipher exceeds the value of the encrypted information
If the time required to break the cipher exceeds the useful lifetime of the
information.
Kerkhoff’s Principle: A cryptosystem should be secure even if the attacker knows
all the details about the system, with the exception of the secret key.
18
SUBSTITUTION TECHNIQUES
A substitution technique is one in which the letters of plaintext are replaced by
other letters or by numbers or symbols.
Substitution ciphers can be categorized as either
i) Monoalphabetic ciphers ii) polyalphabetic ciphers.
In monoalphabetic substitution, the relationship between a symbol in the plaintext
to a symbol in the ciphertext is always one-to-one.
In polyalphabetic substitution, each occurrence of a character may have a
different substitute. The relationship between a character in the plaintext to a
character in the ciphertext is one-to-many.
19
SUBSTITUTION TECHNIQUES
Various substitution ciphers are
(i) Caesar Cipher or Shift cipher
(ii) Mono alphabetic cipher (Frequency analysis)
(iii) Playfair cipher
(iv) Hill cipher
(v) Vignere cipher
(vi) Vernam cipher
(vii)One Time Pad
20
(i) CAESAR CIPHER (OR) SHIFT CIPHER
• Caesar cipher was proposed by Julius Caesar. The Caesar cipher involves
replacing each letter of the alphabet with the letter standing 3 places further down
the alphabet.
21
(i) CAESAR CIPHER (OR) SHIFT CIPHER
For each plaintext letter P, substitute the cipher text letter c such that
C = E(3, P) = (P+3) mod 26
Decryption is P=D(3,C)=(C-3) mod 26
The general Caesar algorithm is
C = E(K, P) = (P + K) mod 26 where k takes on a value in the range 1 to 25.
The decryption algorithm is simply
P = D(K, C) = (C - K) mod 26
If it is known that a given cipher text is a Caesar cipher, then a brute-force
cryptanalysis is easily performed: simply try all the 25 possible keys.
Cryptanalysis of Caesar Cipher
1. The encryption and decryption algorithms are known.
2. There are only 25 possible keys. Hence brute force attack takes place
3. The language of the plaintext is known and easily recognizable 22
ii) MONOALPHABETIC CIPHER
Each plaintext letter maps to a different random cipher text letter
Here, 26! Possible keys are used to eliminate brute force attack
• There is, however, another line of attack. If the cryptanalyst knows the nature of
the plaintext (e.g., non-compressed English text), then the analyst can exploit the
regularities of the language.
• As a first step, the relative frequency of the letters can be determined and
compared to a standard frequency distribution for English
23
ii) MONOALPHABETIC CIPHER
24
ii) MONOALPHABETIC CIPHER
25
ii) MONOALPHABETIC CIPHER
Disadvantage of Monoalphabetic Ciphers:
They are easy to break because they reflect frequency data of the original
alphabet.
A countermeasure is to provide multiple substitutes known as homophones for a
single letter.
• Eg: the letter ‘e’ could be assigned a number of different cipher symbols such as
16, 74, 35 and 21 with each homophone assigned to a letter in rotation or
randomly.
26