KEMBAR78
Module-1.ppt cryptography and network security | PPT
Cryptography and Network
Security
Module-1 (Basics of Security and
Traditional Cryptosystems)
OSI security architecture – Security attacks,
Services, Mechanisms.
Cryptography vs Cryptanalysis. Classical
encryption techniques – Symmetric cipher model.
Substitution ciphers – Monoalphabetic vs
Polyalphabetic ciphers, Caesar cipher, Affine
cipher, Playfair cipher, Vigenere cipher, Hill
cipher.
Transposition ciphers – Keyless, Keyed, Double
transposition.
Background
• Information Security requirements have
changed in recent times
• traditionally provided by physical and
administrative mechanisms
• computer use requires automated tools to
protect files and other stored information
• use of networks and communications links
requires measures to protect data during
transmission
Definitions
• Computer Security - generic name for
the collection of tools designed to protect
data and to thwart hackers
• Network Security - measures to protect
data during their transmission
• Internet Security - measures to protect
data during their transmission over a
collection of interconnected networks
Aim of Course
• our focus is on Internet Security
• consists of measures to deter, prevent,
detect, and correct security violations that
involve the transmission of information
OSI Security Architecture
• To assess effectively the security needs of an
organization and to evaluate and choose various
security products and policies, the manager
responsible for security needs some systematic
way of defining the requirements for security and
characterizing the approaches to satisfying
those requirements.
• This is difficult enough in a centralized data
processing environment; with the use of local
and wide area networks, the problems are
compounded.
OSI Security Architecture
• ITU-T X.800 Security Architecture for OSI
• defines a systematic way of defining and providing
security requirements
• The OSI security architecture is useful to managers
as a way of organizing the task of providing
security.
• Because this architecture was developed as an
international standard, computer and
communications vendors have developed security
features for their products and services that relate
to this structured definition of services and
mechanisms
Services, Mechanisms, Attacks
• The OSI security architecture focuses on security
attacks, mechanisms, and services. These can be
defined briefly as follows:
• ● Security attack: Any action that compromises the
security of information owned by an organization.
• ● Security mechanism: A process (or a device
incorporating such a process) that is designed to detect,
prevent, or recover from a security attack.
• ● Security service: A processing or communication service
that enhances the security of the data processing systems
and the information transfers of an organization. The
services are intended to counter security attacks, and they
make use of one or more security mechanisms to provide
the service
Security Attack
• any action that compromises the security
of information owned by an organization
• information security is about how to
prevent attacks, or failing that, to detect
attacks on information-based systems
• have a wide range of attacks
• can focus of generic types of attacks
• note: often threat & attack mean same
Security Attack
• Two types- Passive attack & Active attack.
• A passive attack attempts to learn or make
use of information from the system but
does not affect system resources. An
active attack attempts to alter system
resources or affect their operation
Passive Attack
• Passive attacks are in the nature of
eavesdropping on, or monitoring of,
transmissions. The goal of the opponent is
to obtain information that is being
transmitted. Two types of passive attacks
are release of message contents and
traffic analysis
Passive Attack
• The release of message contents is
easily understood . A telephone
conversation, an electronic mail message,
and a transferred file may contain
sensitive or confidential information. We
would like to prevent an opponent from
learning the contents of these
transmissions.
Passive Attacks
• Traffic analysis- Suppose that we had a way of
masking the contents of messages or other
information traffic so that opponents, even if they
captured the message, could not extract the
information from the message. The common
technique for masking contents is encryption.
Passive Attacks
• Passive attacks are very difficult to detect
because they do not involve any alteration of the
data. Typically, the message traffic is sent and
received in an apparently normal fashion and
neither the sender nor receiver is aware that a
third party has read the messages or observed
the traffic pattern. However, it is feasible to
prevent the success of these attacks, usually by
means of encryption. Security Attacks the
emphasis in dealing with passive attacks is on
prevention rather than detection.
Active Attacks
• Active attacks involve some modification of the
data stream or the creation of a false stream and
can be subdivided into four categories:
masquerade, replay, modification of messages,
and denial of service.
• A masquerade takes place when one entity
pretends to be a different entity
Active Attacks
• Replay involves the passive capture of a data unit and its
subsequent retransmission to produce an unauthorized
effect.
• Modification of messages simply means that some portion
of a legitimate message is altered, or that messages are
delayed or reordered, to produce an unauthorized effect
For example, a message meaning "Allow John Smith to
read confidential file accounts" is modified to mean "Allow
Fred Brown to read confidential file accounts.“.
• The denial of service prevents or inhibits the normal use or
management of communications facilities. Another form of
service denial is the disruption of an entire network, either
by disabling the network or by overloading it with
messages so as to degrade performance.
Security Mechanism
• a mechanism that is designed to detect,
prevent, or recover from a security attack
• no single mechanism that will support all
functions required
• however one particular element underlies
many of the security mechanisms in use:
cryptographic techniques
• hence our focus on this area
Security Service
– is something that enhances the security of the
data processing systems and the information
transfers of an organization
– intended to counter security attacks
– make use of one or more security
mechanisms to provide the service
Security Services
• X.800 defines it as: a service provided by
a protocol layer of communicating open
systems, which ensures adequate security
of the systems or of data transfers
• RFC 2828 defines it as: a processing or
communication service provided by a
system to give a specific kind of protection
to system resources
• X.800 defines it in 5 major categories
Security Services (X.800)
• Authentication - assurance that the
communicating entity is the one claimed
• Access Control - prevention of the
unauthorized use of a resource
• Data Confidentiality –protection of data from
unauthorized disclosure
• Data Integrity - assurance that data received is
as sent by an authorized entity
• Non-Repudiation - protection against denial by
one of the parties in a communication
2
7
Cryptography &Network Security
• Cryptography is the science or art of secret writing.
• The fundamental objective of cryptography is to enable two
people for a secure communication over a public channel in
such a way that an opponent cannot understand what is
being said
2
8
Security Goals
• Confidentiality-The most common aspect of information
security.
• - only authorized user can access. Eg., Confidential letters
should be opened by only the addressee
• Data integrity - Protecting data from unauthorized
changes Eg. Modification in Mark statement to be done
by University authorities only. Bank a/c balance to be
updated by bank authorities only.
• Data Availability – Information to be available whenever
it is required. Eg. Accessibility of the a/c while
withdrawing money from ATM.
29
Security Goals
Integrity
Confidentiality
Avalaibility
3
0
Overview of Cryptography
• Cryptography – design & analysis of math techniques
for secure communication of data in the presence of
adversaries over an insecure Channel.
• Cryptography involves techniques to secure the
data/systems from illegitimate users.
• Legitimate Users: Sender & Receiver.
• Illegitimate Users: Eavesdropper, Adversary,
opponent, unauthorized person.
3
1
AIM of Cryptography
• Securing data / systems from adversaries
– Change the data from meaningful/intelligible
form to meaningless/unintelligible form by
scrambling (transforming) it; called as Encryption.
– Protecting the data by hiding it in the multimedia
data such as images, audio, video; called as
Steganography (not a part of cryptography).
3
2
Some Terminology
• plaintext - original message.
• ciphertext - encoded message.
• key - info used to generate ciphertext and it is known only to
sender/receiver
• encipher (encryption) - converting plaintext to ciphertext
• decipher (decryption) - recovering plaintext from ciphertext
• Cryptography ={ algorithms used for encryption, decryption and message
digest generation}
• Cryptanalysis: Techniques used for breaking the cipher text without
knowing the key.
• Cryptology = Cryptography + Cryptanalysis.
3
3
Types of Cryptosystems
• Secret Key Cryptosystem ( Symmetric key,
conventional, single key)
• Public key Cryptosystem (Asymmetric key, Two
Key)
• Hybrid Cryptosystem ( uses both systems)
Secret Key Cryptosystem
Simplified model of Conventional
Encryption System
3
4
Requirements
There are two requirements for secure use of
symmetric encryption:
- a strong encryption algorithm
- a secret key known only to sender / receiver
Y = EK(X)
X = DK(Y)
assume encryption algorithm is known
implies a secure channel to distribute key
Model of Conventional System
Cryptography
Cryptographic systems can characterize by:
1. The type of operations used for encryption
substitution / transposition / product
2. Number of keys used
single-key or private / two-key or public
3. The way in which plaintext is processed
block / stream
Cryptanalysis
The objective of attacking is to recover the key
Two approaches
1. Cryptanalysis: Cryptanalytic attack rely on the nature
of algorithms plus some knowledge of the general
characteristics of the plain text or some plain text cipher
text pair
2. Brute-force attack- The attacker tries every possible
key on a piece of ciphertext until an intelligible
translation in to plain text is obtained.
Types of Cryptanalytic Attacks
ciphertext only
only know algorithm / ciphertext, statistical, can identify plaintext
known plaintext
know/suspect plaintext & ciphertext to attack cipher
chosen plaintext
select plaintext and obtain ciphertext to attack cipher
chosen ciphertext
select ciphertext and obtain plaintext to attack cipher
chosen text
select either plaintext or ciphertext to en/decrypt to attack cipher
More Definitions
unconditional security –An encryption system is unconditionally
secure ,
no matter how much computer power is available, the cipher
cannot be broken since the ciphertext provides insufficient
information to uniquely determine the corresponding plaintext.
computational security –if either of the following two conditions
met:
- The cost of breaking the cipher exceeds the value of the
encrypted information
- The time required to break the cipher exceeds the useful life
time of the information.
4
1
Categories of Traditional Ciphers
• Traditional symmetric key ciphers are
classified in to two broad categories:
• - Substitution ciphers
• - Transposition ciphers
4
2
Substitution
• Substitution – replaces one letter with another.
– Mono-alphabetic substitution – In monoalphabetic substitution ,a
character in the plain text is always changed to the same character in
the cipher text regardless of their position in the text. Eg., if ‘t’ is
replaced by ‘u’ at one place, then ‘t’ will be replaced by same latter
‘u’ everywhere.
– Poly-alphabetic substitution – Each letter is replaced by any one letter
in a set depending on the context. Eg., if ‘t’ is replaced by ‘u’ at one
place, then ‘t’ will not be replaced by same latter ‘u’ everywhere; but
it will be replaced by some other letter in the same set.
– Example: Mono-alphabetic substitution . text - UFYU (substitute by it
successor) – intelligible form🡪 unintelligible form
– Example: Poly-alphabetic substitution. Test-- LKZS. Here t is replaced
by L at one place and t is replaced by S at another place. (playfair
cipher)
4
3
Permutation
• Permutation (transposition) – interchange the
symbols. i.e. permute the symbols i.e.,
rearrange the symbols i.e., change the
order of the symbols.
– Example: Test 🡪etst (1234 is rearranged as 2134)
4
4
Monoalphabetic Ciphers
• Additive cipher
• Shift Cipher
• Caesar Cipher
• Multiplicative Cipher
• Affine Cipher
• Monoalphabetic substitution Cipher
4
5
Additive Cipher
• The simplest monoalphabetic cipher.
• Sometimes this cipher is also called a Shift Cipher
and sometimes a Caesar Cipher
4
6
Additive Cipher
4
7
Shift Cipher
• Additive ciphers are called shift ciphers
• The encryption algorithm can be interpreted
as “shift key characters down”
•
4
8
Caesar Cipher
• Julius Caesar used an additive cipher to communicate with his officers
•
• Key used is 3
•
• So additive ciphers are also known as the Caesar Cipher
4
9
Cryptanalysis of Caesar Cipher
• Brute force attack on key (i.e, exhaustive key search).
Try for k=1, k=2, … k=25. Find the value of k for which
you get meaningful form.
• Example. Perform cryptanalysis on the following
cipher text: JBCRCLQRWCRVNBJENBWRWN
• Ans: Try for k=1🡪 iabqbkp… for k=2🡪 hzapaj…
for k=3…for k=9🡪astitchintimesavesnine
5
0
5
2
Multiplicative Cipher
• The encryption algorithm specifies multiplication of
the plain text by the key and decryption algorithm
specifies division of the cipher text by the key
•
•
5
4
Affine Cipher
• The combination of additive and multiplicative
ciphers with a pair of keys
• The first key is used with multiplicative cipher and
second with the additive cipher
•
•
5
7
MONOALPHABETIC Substitution Cipher
• Plain text – x, Cipher text – y.
• Key k = permutation of 0,1,2,…25.
• Cryptanalysis. Brute force attack- no of possible
keys = 26! – takes time. Use frequency analysis
5
8
Cryptanalysis of mono-alphabetic
substitution algorithms
• Generate tables of single, double & triple
letter frequencies for various languages
• Eg. Single letter frequency for English is :
• Frequently used letters are: E,T,R,N,I,O,A,S
• Rarely used letters are: Z,J,K,Q,X.
5
9
6
0
Frequency cryptanalysis.Example.
• given ciphertext:
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
• count relative letter frequencies – P has the highest frequency
and then Z has next higher frequency...
• guess P & Z are e and t
• guess ZW is th and hence ZWP is the
• proceeding with trial and error finally get:
it was disclosed yesterday that several informal but direct
contacts have been made with political representatives of the
viet cong in moscow
6
1
Poly-alphabetic Substitution algorithms-
Playfair cipher
• Instead of encrypting character by character, playfair
encrypts pair by pair.
• Algorithm:
• Generate a 5X5 matrix of letters based on a keyword
fill in letters of keyword (remove duplicates)
fill rest of matrix with other letters eg. using the
keyword MONARCHY
6
2
Playfair…
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
6
3
Playfair…
• plaintext is encrypted two letters at a time
1. if a pair is a repeated letter, insert a filler like 'X', eg. "balloon"
encrypts as "ba lx lo on"
2. if both letters fall in the same row, replace each with letter to
right (wrapping back to start from end), eg. “ar" encrypts as
"RM"
3. if both letters fall in the same column, replace each with the
letter below it (again wrapping to top from bottom), eg. “mu"
encrypts to "CM"
4. otherwise each letter is replaced by the one in its row in the
column of the other letter of the pair, eg. “hs" encrypts to "BP",
and “ea" to "IM" or "JM" (as desired)
6
4
Playfair…
• Decrypting works exactly in reverse
• Example. Encrypt balloon and verify the
process by decrypting it.
Security of the Playfair Cipher
• security much improved over monoalphabetic
• since have 26 x 26 = 676 digrams
• would need a 676 entry frequency table to analyse (verses
26 for a monoalphabetic) and correspondingly more
ciphertext
• was widely used for many years (eg. US & British military in
WW1)
6
6
Playfair…
Hill cipher
• Invented by L. S. Hill in 1929.
• Inputs : String of English letters, A,B,…,Z.
An mm matrix K, with entries drawn from 0,1,…,25.
(The matrix K serves as the secret key. )
• The encryption takes m successive plain text letters and
substitutes for them m ciphertext letters.
• The substitution is determined by m linear equations.
• For m=3, the system can be described as follows,
Note
• The decryption must be the inverse function of the
encryption function.
– It is required that K-1 K = In mod 26.
• Provided that det(K) has a multiplicative inverse mod 26,
i.e., if det(K) and n has no common factor, the inverse of K
can be computed by the adjoint formula for matrix inverse.
• Inverse of an integer mod 26 can be obtained by trial and
error.
Example
• Plain text: “LOVE”, Secret Key:
• “LO” 
“VE” 
• 2, 3, 16, 5 are transformed to cipher text
“CDQF”
How to decode?
• Given “CDQF”, and the encryption matrix
• How do we decrypt?
– We need to compute the inverse of
• Remind that all arithmetic are mod 26. There is
no fraction and care should be taken in
computing multiplicative inverse mod 26.
Polyalphabetic
Substitution Ciphers
• Another approach to improving security is to use different
monoalphabetic substitution through plain text - called
polyalphabetic substitution ciphers .
• This makes cryptanalysis harder with more alphabets to
guess and flatter frequency distribution
• use a key to select which alphabet is used for each letter
of the message
• use each alphabet in turn
• repeat from start after end of key is reached
Vigenère Cipher
• The simplest polyalphabetic substitution cipher is the
Vigenère Cipher
• The set of related monoalphabetic substitution rules
consists of 26 Caesar ciphers are used here.
• key is multiple letters long K = k1 k2 ... kd
• ith letter specifies ith alphabet to use
• use each alphabet in turn
• repeat from start after d letters in message
• decryption simply works in reverse
Example
• write the plaintext out
• write the keyword repeated above it
• use each key letter as a caesar cipher key
• encrypt the corresponding plaintext letter
• eg using keyword deceptive
• key: deceptivedeceptivedeceptive
• plaintext: wearediscoveredsaveyourself
• ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ
Aids
Encryption and Decryption
• The process of encryption is simple: Given a key
letter X and a plain text Y , the ciphertext letter is at
the intersection of the row labeled X and the
column labeled Y.
• Decryption is equally simple.
• The key letter again identifies the row. The position
of the ciphertext letter in that row determines the
column,and the plain text letter is at the top of that
column.
Security of Vigenère Ciphers
• have multiple ciphertext letters for each plaintext
letter
• hence letter frequencies are obscured
• but not totally lost
Autokey Cipher
• ideally want a key as long as the message
• Vigenère proposed the autokey cipher
• with keyword is prefixed to message as key
• knowing keyword can recover the first few letters
• use these in turn on the rest of the message
• but still have frequency characteristics to attack
• eg. given key deceptive
• key: deceptivewearediscoveredsav
• plaintext: wearediscoveredsaveyourself
• ciphertext:ZICVTWQNGKZEIIGASXSTSLVVWLA
VERNAM CIPHER
• Choose a keyword that is as long as
the plain text
One-Time Pad
• if a truly random key as long as the message
is used, the cipher will be secure
• called a One-Time pad
• is unbreakable since ciphertext bears no
statistical relationship to the plaintext
• since for any plaintext & any ciphertext
there exists a key mapping one to other
• can only use the key once though
• have problem of safe distribution of key
Transposition Ciphers
• Now consider classical transposition or
permutation ciphers
• these hide the message by rearranging the
letter order
• without altering the actual letters used
• can recognise these since have the same
frequency distribution as the original text
Rail Fence cipher
• write message letters out diagonally over a
number of rows
• then read off cipher row by row
• eg. write message out as:
m e m a t r h t g p r y
e t e f e t e o a a t
• giving ciphertext
MEMATRHTGPRYETEFETEOAAT
Row Transposition Ciphers
• a more complex scheme
• write letters of message out in rows over
a specified number of columns
• then reorder the columns according to
some key before reading off the rows
Key: 4 3 1 2 5 6 7
Plaintext: a t t a c k p
o s t p o n e
d u n t i l t
w o a m x y z
Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
Double Transposition Ciphers
• The transposition cipher can be made significantly more
secure by performing more than one stage of
• transposition. The result is a more complex permutation
that is not easily reconstructed. Thus, if the
• foregoing message is reencrypted using the same
algorithm,
• Key: 4 3 1 2 5 6 7
• Input: t t n a a p t
m t s u o a o
d w c o i x k
n l y p e t z
• Output: NSCYAUOPTTWLTMDNAOIEPAXTTOKZ
Product Ciphers
• ciphers using substitutions or transpositions are not secure
because of language characteristics
• hence consider using several ciphers in succession to make
harder, but:
– two substitutions make a more complex
substitution
– two transpositions make more complex
transposition
– but a substitution followed by a transposition
makes a new much harder cipher
• this is bridge from classical to modern ciphers
Steganography
• an alternative to encryption
• hides existence of message
• using only a subset of letters/words in a
longer message marked in some way
• using invisible ink
• hiding in LSB in graphic image or sound file
• has drawbacks
• high overhead to hide relatively few info bits
Summary
• have considered:
– classical cipher techniques and
terminology
– monoalphabetic substitution ciphers
– cryptanalysis using letter frequencies
– Playfair ciphers
– polyalphabetic ciphers
– transposition ciphers
– product ciphers and rotor machines
– steganography

Module-1.ppt cryptography and network security

  • 1.
  • 2.
    Module-1 (Basics ofSecurity and Traditional Cryptosystems) OSI security architecture – Security attacks, Services, Mechanisms. Cryptography vs Cryptanalysis. Classical encryption techniques – Symmetric cipher model. Substitution ciphers – Monoalphabetic vs Polyalphabetic ciphers, Caesar cipher, Affine cipher, Playfair cipher, Vigenere cipher, Hill cipher. Transposition ciphers – Keyless, Keyed, Double transposition.
  • 3.
    Background • Information Securityrequirements have changed in recent times • traditionally provided by physical and administrative mechanisms • computer use requires automated tools to protect files and other stored information • use of networks and communications links requires measures to protect data during transmission
  • 4.
    Definitions • Computer Security- generic name for the collection of tools designed to protect data and to thwart hackers • Network Security - measures to protect data during their transmission • Internet Security - measures to protect data during their transmission over a collection of interconnected networks
  • 5.
    Aim of Course •our focus is on Internet Security • consists of measures to deter, prevent, detect, and correct security violations that involve the transmission of information
  • 6.
    OSI Security Architecture •To assess effectively the security needs of an organization and to evaluate and choose various security products and policies, the manager responsible for security needs some systematic way of defining the requirements for security and characterizing the approaches to satisfying those requirements. • This is difficult enough in a centralized data processing environment; with the use of local and wide area networks, the problems are compounded.
  • 7.
    OSI Security Architecture •ITU-T X.800 Security Architecture for OSI • defines a systematic way of defining and providing security requirements • The OSI security architecture is useful to managers as a way of organizing the task of providing security. • Because this architecture was developed as an international standard, computer and communications vendors have developed security features for their products and services that relate to this structured definition of services and mechanisms
  • 8.
    Services, Mechanisms, Attacks •The OSI security architecture focuses on security attacks, mechanisms, and services. These can be defined briefly as follows: • ● Security attack: Any action that compromises the security of information owned by an organization. • ● Security mechanism: A process (or a device incorporating such a process) that is designed to detect, prevent, or recover from a security attack. • ● Security service: A processing or communication service that enhances the security of the data processing systems and the information transfers of an organization. The services are intended to counter security attacks, and they make use of one or more security mechanisms to provide the service
  • 9.
    Security Attack • anyaction that compromises the security of information owned by an organization • information security is about how to prevent attacks, or failing that, to detect attacks on information-based systems • have a wide range of attacks • can focus of generic types of attacks • note: often threat & attack mean same
  • 10.
    Security Attack • Twotypes- Passive attack & Active attack. • A passive attack attempts to learn or make use of information from the system but does not affect system resources. An active attack attempts to alter system resources or affect their operation
  • 11.
    Passive Attack • Passiveattacks are in the nature of eavesdropping on, or monitoring of, transmissions. The goal of the opponent is to obtain information that is being transmitted. Two types of passive attacks are release of message contents and traffic analysis
  • 12.
    Passive Attack • Therelease of message contents is easily understood . A telephone conversation, an electronic mail message, and a transferred file may contain sensitive or confidential information. We would like to prevent an opponent from learning the contents of these transmissions.
  • 14.
    Passive Attacks • Trafficanalysis- Suppose that we had a way of masking the contents of messages or other information traffic so that opponents, even if they captured the message, could not extract the information from the message. The common technique for masking contents is encryption.
  • 16.
    Passive Attacks • Passiveattacks are very difficult to detect because they do not involve any alteration of the data. Typically, the message traffic is sent and received in an apparently normal fashion and neither the sender nor receiver is aware that a third party has read the messages or observed the traffic pattern. However, it is feasible to prevent the success of these attacks, usually by means of encryption. Security Attacks the emphasis in dealing with passive attacks is on prevention rather than detection.
  • 17.
    Active Attacks • Activeattacks involve some modification of the data stream or the creation of a false stream and can be subdivided into four categories: masquerade, replay, modification of messages, and denial of service. • A masquerade takes place when one entity pretends to be a different entity
  • 19.
    Active Attacks • Replayinvolves the passive capture of a data unit and its subsequent retransmission to produce an unauthorized effect. • Modification of messages simply means that some portion of a legitimate message is altered, or that messages are delayed or reordered, to produce an unauthorized effect For example, a message meaning "Allow John Smith to read confidential file accounts" is modified to mean "Allow Fred Brown to read confidential file accounts.“. • The denial of service prevents or inhibits the normal use or management of communications facilities. Another form of service denial is the disruption of an entire network, either by disabling the network or by overloading it with messages so as to degrade performance.
  • 23.
    Security Mechanism • amechanism that is designed to detect, prevent, or recover from a security attack • no single mechanism that will support all functions required • however one particular element underlies many of the security mechanisms in use: cryptographic techniques • hence our focus on this area
  • 24.
    Security Service – issomething that enhances the security of the data processing systems and the information transfers of an organization – intended to counter security attacks – make use of one or more security mechanisms to provide the service
  • 25.
    Security Services • X.800defines it as: a service provided by a protocol layer of communicating open systems, which ensures adequate security of the systems or of data transfers • RFC 2828 defines it as: a processing or communication service provided by a system to give a specific kind of protection to system resources • X.800 defines it in 5 major categories
  • 26.
    Security Services (X.800) •Authentication - assurance that the communicating entity is the one claimed • Access Control - prevention of the unauthorized use of a resource • Data Confidentiality –protection of data from unauthorized disclosure • Data Integrity - assurance that data received is as sent by an authorized entity • Non-Repudiation - protection against denial by one of the parties in a communication
  • 27.
    2 7 Cryptography &Network Security •Cryptography is the science or art of secret writing. • The fundamental objective of cryptography is to enable two people for a secure communication over a public channel in such a way that an opponent cannot understand what is being said
  • 28.
    2 8 Security Goals • Confidentiality-Themost common aspect of information security. • - only authorized user can access. Eg., Confidential letters should be opened by only the addressee • Data integrity - Protecting data from unauthorized changes Eg. Modification in Mark statement to be done by University authorities only. Bank a/c balance to be updated by bank authorities only. • Data Availability – Information to be available whenever it is required. Eg. Accessibility of the a/c while withdrawing money from ATM.
  • 29.
  • 30.
    3 0 Overview of Cryptography •Cryptography – design & analysis of math techniques for secure communication of data in the presence of adversaries over an insecure Channel. • Cryptography involves techniques to secure the data/systems from illegitimate users. • Legitimate Users: Sender & Receiver. • Illegitimate Users: Eavesdropper, Adversary, opponent, unauthorized person.
  • 31.
    3 1 AIM of Cryptography •Securing data / systems from adversaries – Change the data from meaningful/intelligible form to meaningless/unintelligible form by scrambling (transforming) it; called as Encryption. – Protecting the data by hiding it in the multimedia data such as images, audio, video; called as Steganography (not a part of cryptography).
  • 32.
    3 2 Some Terminology • plaintext- original message. • ciphertext - encoded message. • key - info used to generate ciphertext and it is known only to sender/receiver • encipher (encryption) - converting plaintext to ciphertext • decipher (decryption) - recovering plaintext from ciphertext • Cryptography ={ algorithms used for encryption, decryption and message digest generation} • Cryptanalysis: Techniques used for breaking the cipher text without knowing the key. • Cryptology = Cryptography + Cryptanalysis.
  • 33.
    3 3 Types of Cryptosystems •Secret Key Cryptosystem ( Symmetric key, conventional, single key) • Public key Cryptosystem (Asymmetric key, Two Key) • Hybrid Cryptosystem ( uses both systems)
  • 34.
    Secret Key Cryptosystem Simplifiedmodel of Conventional Encryption System 3 4
  • 35.
    Requirements There are tworequirements for secure use of symmetric encryption: - a strong encryption algorithm - a secret key known only to sender / receiver Y = EK(X) X = DK(Y) assume encryption algorithm is known implies a secure channel to distribute key
  • 36.
  • 37.
    Cryptography Cryptographic systems cancharacterize by: 1. The type of operations used for encryption substitution / transposition / product 2. Number of keys used single-key or private / two-key or public 3. The way in which plaintext is processed block / stream
  • 38.
    Cryptanalysis The objective ofattacking is to recover the key Two approaches 1. Cryptanalysis: Cryptanalytic attack rely on the nature of algorithms plus some knowledge of the general characteristics of the plain text or some plain text cipher text pair 2. Brute-force attack- The attacker tries every possible key on a piece of ciphertext until an intelligible translation in to plain text is obtained.
  • 39.
    Types of CryptanalyticAttacks ciphertext only only know algorithm / ciphertext, statistical, can identify plaintext known plaintext know/suspect plaintext & ciphertext to attack cipher chosen plaintext select plaintext and obtain ciphertext to attack cipher chosen ciphertext select ciphertext and obtain plaintext to attack cipher chosen text select either plaintext or ciphertext to en/decrypt to attack cipher
  • 40.
    More Definitions unconditional security–An encryption system is unconditionally secure , no matter how much computer power is available, the cipher cannot be broken since the ciphertext provides insufficient information to uniquely determine the corresponding plaintext. computational security –if either of the following two conditions met: - The cost of breaking the cipher exceeds the value of the encrypted information - The time required to break the cipher exceeds the useful life time of the information.
  • 41.
    4 1 Categories of TraditionalCiphers • Traditional symmetric key ciphers are classified in to two broad categories: • - Substitution ciphers • - Transposition ciphers
  • 42.
    4 2 Substitution • Substitution –replaces one letter with another. – Mono-alphabetic substitution – In monoalphabetic substitution ,a character in the plain text is always changed to the same character in the cipher text regardless of their position in the text. Eg., if ‘t’ is replaced by ‘u’ at one place, then ‘t’ will be replaced by same latter ‘u’ everywhere. – Poly-alphabetic substitution – Each letter is replaced by any one letter in a set depending on the context. Eg., if ‘t’ is replaced by ‘u’ at one place, then ‘t’ will not be replaced by same latter ‘u’ everywhere; but it will be replaced by some other letter in the same set. – Example: Mono-alphabetic substitution . text - UFYU (substitute by it successor) – intelligible form🡪 unintelligible form – Example: Poly-alphabetic substitution. Test-- LKZS. Here t is replaced by L at one place and t is replaced by S at another place. (playfair cipher)
  • 43.
    4 3 Permutation • Permutation (transposition)– interchange the symbols. i.e. permute the symbols i.e., rearrange the symbols i.e., change the order of the symbols. – Example: Test 🡪etst (1234 is rearranged as 2134)
  • 44.
    4 4 Monoalphabetic Ciphers • Additivecipher • Shift Cipher • Caesar Cipher • Multiplicative Cipher • Affine Cipher • Monoalphabetic substitution Cipher
  • 45.
    4 5 Additive Cipher • Thesimplest monoalphabetic cipher. • Sometimes this cipher is also called a Shift Cipher and sometimes a Caesar Cipher
  • 46.
  • 47.
    4 7 Shift Cipher • Additiveciphers are called shift ciphers • The encryption algorithm can be interpreted as “shift key characters down” •
  • 48.
    4 8 Caesar Cipher • JuliusCaesar used an additive cipher to communicate with his officers • • Key used is 3 • • So additive ciphers are also known as the Caesar Cipher
  • 49.
    4 9 Cryptanalysis of CaesarCipher • Brute force attack on key (i.e, exhaustive key search). Try for k=1, k=2, … k=25. Find the value of k for which you get meaningful form. • Example. Perform cryptanalysis on the following cipher text: JBCRCLQRWCRVNBJENBWRWN • Ans: Try for k=1🡪 iabqbkp… for k=2🡪 hzapaj… for k=3…for k=9🡪astitchintimesavesnine
  • 50.
  • 52.
    5 2 Multiplicative Cipher • Theencryption algorithm specifies multiplication of the plain text by the key and decryption algorithm specifies division of the cipher text by the key • •
  • 54.
    5 4 Affine Cipher • Thecombination of additive and multiplicative ciphers with a pair of keys • The first key is used with multiplicative cipher and second with the additive cipher • •
  • 57.
    5 7 MONOALPHABETIC Substitution Cipher •Plain text – x, Cipher text – y. • Key k = permutation of 0,1,2,…25. • Cryptanalysis. Brute force attack- no of possible keys = 26! – takes time. Use frequency analysis
  • 58.
    5 8 Cryptanalysis of mono-alphabetic substitutionalgorithms • Generate tables of single, double & triple letter frequencies for various languages • Eg. Single letter frequency for English is : • Frequently used letters are: E,T,R,N,I,O,A,S • Rarely used letters are: Z,J,K,Q,X.
  • 59.
  • 60.
    6 0 Frequency cryptanalysis.Example. • givenciphertext: UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ • count relative letter frequencies – P has the highest frequency and then Z has next higher frequency... • guess P & Z are e and t • guess ZW is th and hence ZWP is the • proceeding with trial and error finally get: it was disclosed yesterday that several informal but direct contacts have been made with political representatives of the viet cong in moscow
  • 61.
    6 1 Poly-alphabetic Substitution algorithms- Playfaircipher • Instead of encrypting character by character, playfair encrypts pair by pair. • Algorithm: • Generate a 5X5 matrix of letters based on a keyword fill in letters of keyword (remove duplicates) fill rest of matrix with other letters eg. using the keyword MONARCHY
  • 62.
    6 2 Playfair… M O NA R C H Y B D E F G I/J K L P Q S T U V W X Z
  • 63.
    6 3 Playfair… • plaintext isencrypted two letters at a time 1. if a pair is a repeated letter, insert a filler like 'X', eg. "balloon" encrypts as "ba lx lo on" 2. if both letters fall in the same row, replace each with letter to right (wrapping back to start from end), eg. “ar" encrypts as "RM" 3. if both letters fall in the same column, replace each with the letter below it (again wrapping to top from bottom), eg. “mu" encrypts to "CM" 4. otherwise each letter is replaced by the one in its row in the column of the other letter of the pair, eg. “hs" encrypts to "BP", and “ea" to "IM" or "JM" (as desired)
  • 64.
    6 4 Playfair… • Decrypting worksexactly in reverse • Example. Encrypt balloon and verify the process by decrypting it.
  • 65.
    Security of thePlayfair Cipher • security much improved over monoalphabetic • since have 26 x 26 = 676 digrams • would need a 676 entry frequency table to analyse (verses 26 for a monoalphabetic) and correspondingly more ciphertext • was widely used for many years (eg. US & British military in WW1)
  • 66.
  • 67.
    Hill cipher • Inventedby L. S. Hill in 1929. • Inputs : String of English letters, A,B,…,Z. An mm matrix K, with entries drawn from 0,1,…,25. (The matrix K serves as the secret key. ) • The encryption takes m successive plain text letters and substitutes for them m ciphertext letters. • The substitution is determined by m linear equations. • For m=3, the system can be described as follows,
  • 69.
    Note • The decryptionmust be the inverse function of the encryption function. – It is required that K-1 K = In mod 26. • Provided that det(K) has a multiplicative inverse mod 26, i.e., if det(K) and n has no common factor, the inverse of K can be computed by the adjoint formula for matrix inverse. • Inverse of an integer mod 26 can be obtained by trial and error.
  • 70.
    Example • Plain text:“LOVE”, Secret Key: • “LO”  “VE”  • 2, 3, 16, 5 are transformed to cipher text “CDQF”
  • 71.
    How to decode? •Given “CDQF”, and the encryption matrix • How do we decrypt? – We need to compute the inverse of • Remind that all arithmetic are mod 26. There is no fraction and care should be taken in computing multiplicative inverse mod 26.
  • 72.
    Polyalphabetic Substitution Ciphers • Anotherapproach to improving security is to use different monoalphabetic substitution through plain text - called polyalphabetic substitution ciphers . • This makes cryptanalysis harder with more alphabets to guess and flatter frequency distribution • use a key to select which alphabet is used for each letter of the message • use each alphabet in turn • repeat from start after end of key is reached
  • 73.
    Vigenère Cipher • Thesimplest polyalphabetic substitution cipher is the Vigenère Cipher • The set of related monoalphabetic substitution rules consists of 26 Caesar ciphers are used here. • key is multiple letters long K = k1 k2 ... kd • ith letter specifies ith alphabet to use • use each alphabet in turn • repeat from start after d letters in message • decryption simply works in reverse
  • 74.
    Example • write theplaintext out • write the keyword repeated above it • use each key letter as a caesar cipher key • encrypt the corresponding plaintext letter • eg using keyword deceptive • key: deceptivedeceptivedeceptive • plaintext: wearediscoveredsaveyourself • ciphertext:ZICVTWQNGRZGVTWAVZHCQYGLMGJ
  • 75.
  • 76.
    Encryption and Decryption •The process of encryption is simple: Given a key letter X and a plain text Y , the ciphertext letter is at the intersection of the row labeled X and the column labeled Y. • Decryption is equally simple. • The key letter again identifies the row. The position of the ciphertext letter in that row determines the column,and the plain text letter is at the top of that column.
  • 78.
    Security of VigenèreCiphers • have multiple ciphertext letters for each plaintext letter • hence letter frequencies are obscured • but not totally lost
  • 79.
    Autokey Cipher • ideallywant a key as long as the message • Vigenère proposed the autokey cipher • with keyword is prefixed to message as key • knowing keyword can recover the first few letters • use these in turn on the rest of the message • but still have frequency characteristics to attack • eg. given key deceptive • key: deceptivewearediscoveredsav • plaintext: wearediscoveredsaveyourself • ciphertext:ZICVTWQNGKZEIIGASXSTSLVVWLA
  • 80.
    VERNAM CIPHER • Choosea keyword that is as long as the plain text
  • 81.
    One-Time Pad • ifa truly random key as long as the message is used, the cipher will be secure • called a One-Time pad • is unbreakable since ciphertext bears no statistical relationship to the plaintext • since for any plaintext & any ciphertext there exists a key mapping one to other • can only use the key once though • have problem of safe distribution of key
  • 83.
    Transposition Ciphers • Nowconsider classical transposition or permutation ciphers • these hide the message by rearranging the letter order • without altering the actual letters used • can recognise these since have the same frequency distribution as the original text
  • 84.
    Rail Fence cipher •write message letters out diagonally over a number of rows • then read off cipher row by row • eg. write message out as: m e m a t r h t g p r y e t e f e t e o a a t • giving ciphertext MEMATRHTGPRYETEFETEOAAT
  • 85.
    Row Transposition Ciphers •a more complex scheme • write letters of message out in rows over a specified number of columns • then reorder the columns according to some key before reading off the rows Key: 4 3 1 2 5 6 7 Plaintext: a t t a c k p o s t p o n e d u n t i l t w o a m x y z Ciphertext: TTNAAPTMTSUOAODWCOIXKNLYPETZ
  • 86.
    Double Transposition Ciphers •The transposition cipher can be made significantly more secure by performing more than one stage of • transposition. The result is a more complex permutation that is not easily reconstructed. Thus, if the • foregoing message is reencrypted using the same algorithm, • Key: 4 3 1 2 5 6 7 • Input: t t n a a p t m t s u o a o d w c o i x k n l y p e t z • Output: NSCYAUOPTTWLTMDNAOIEPAXTTOKZ
  • 87.
    Product Ciphers • ciphersusing substitutions or transpositions are not secure because of language characteristics • hence consider using several ciphers in succession to make harder, but: – two substitutions make a more complex substitution – two transpositions make more complex transposition – but a substitution followed by a transposition makes a new much harder cipher • this is bridge from classical to modern ciphers
  • 88.
    Steganography • an alternativeto encryption • hides existence of message • using only a subset of letters/words in a longer message marked in some way • using invisible ink • hiding in LSB in graphic image or sound file • has drawbacks • high overhead to hide relatively few info bits
  • 90.
    Summary • have considered: –classical cipher techniques and terminology – monoalphabetic substitution ciphers – cryptanalysis using letter frequencies – Playfair ciphers – polyalphabetic ciphers – transposition ciphers – product ciphers and rotor machines – steganography