0% found this document useful (0 votes)
56 views134 pages

Cryptography and Network Security

Cryptography notes ppt

Uploaded by

Keerthana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views134 pages

Cryptography and Network Security

Cryptography notes ppt

Uploaded by

Keerthana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 134

Cryptography and

Network Security

MODULE 1
24 July 2017
CRYPTOGRAPHY
2

 Cryptography is a method of storing and


transmitting data in a particular form so that only
those for whom it is intended can read and process
it.

 Cryptography is the science and art of


transforming messages to make them secure and
immune to work.

24 July 2017
CRYPTOGRAPHY
3

 “HIDDEN SECRET”-hiding the information


 Also called cryptology
 The word Cryptology comes from the Greek
word kryptos, which means hidden and logos, which
means word.
 It is the branch of science that deals with secret
communications.

24 July 2017
What is “Security”
4

Dictionary.com says:
 1. Freedom from risk or danger;
safety.
 2. Freedom from doubt, anxiety, or
fear; confidence.
 3. Something that gives or assures
safety.

24 July 2017
Why do we need security?
5

 Protect vital information while still allowing access


to those who need it
 Trade secrets, medical records, etc.
 Provide authentication and access control for
resources
 Guarantee availability of resources

24 July 2017
Security Goals

Confidentiality

Integrity
Avalaibility

6 24 July 2017
Security
7 Goals
 Confidentiality( the state of being secret)
 Concealment of information or resources

 Integrity
 Often requires preventing unauthorized changes

 Trustworthiness of data or resources

 Availability
 Ability to use information or resources

 Attempts to block availability, called denial of service


attacks (DoS) are difficult to detect

24 July 2017
The Need for Security
8

1. Computer security-secure the information


inside the computer
2. Network Security-secure information in the
distributed system.
3. Internet Security - measures to protect data
during their transmission over a collection of
interconnected networks

24 July 2017
Aspects of Network Security
9

 ITU-T Recommendation X.800 “Security


Architecture for OSI” describes network security in
three aspects:
 security attack
 security services
 security mechanism

24 July 2017
Aspects of Network Security
10

 Security attack
 Any action that compromises the security
of information owned by an organization.
 Security services
 That enhances the security of the data
processing systems and the information
transfers of an organization.
 Security mechanism
 A mechanism that is designed to detect,
prevent, or recover from a security attack.
24 July 2017
Security attacks
11

24 July 2017
Security attacks
12

Interception:
 an unauthorized subject has gained access to an
object, such as stealing data, overhearing others
communication, etc.
 Interception causes loss of message
confidentiality.
 The principle of confidentiality specifies that
only the sender and the intended recipient(s)
should be able to access the contents of a
message
24 July 2017
13

24 July 2017
Security attacks
14

 Interruption: services or data become unavailable,


unusable, destroyed, and so on, such as lost of file,
denial of service, etc.
 This is an attack on availability
 Disrupting traffic
 Physically breaking communication line

24 July 2017
15

24 July 2017
Security attacks
16

 Modification: unauthorized changing of data or


tampering with services, such as alteration of data,
modification of messages, etc.
 Modification causes loss of message integrity

24 July 2017
17

24 July 2017
Security attacks
18

 Fabrication: additional data or activities are


generated that would normally no exist, such as
adding a password to a system, replaying previously
send messages, etc
 Fabrication is possible in absence of proper
authentication mechanisms.
 Authentication mechanisms help to establish proof
of identities

24 July 2017
19

24 July 2017
20

24 July 2017
Security attacks 21

 Passive attacks – eavesdropping on or


monitoring of transmissions
 Release of message contents
 Traffic analysis
 Active attacks – modification of the data stream
or creation of a false stream
 Masquerade
 Replay
 Modification of message
 Denial of service

24 July 2017
Passive attacks

 Reading contents22of messages


➢ Difficult to detect passive attacks

 Types
1) Release of message contents
A telephone conversation, an electronic mail
message, and a transferred file may contain
sensitive or confidential information.

24 July 2017
2. Traffic analysis
 Suppose that we had 23 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.

24 July 2017
Active attacks
24

 modification of the data stream or creation


of a false stream
 Masquerade
 Replay
 Modification of message
 Denial of service

24 July 2017
Masquerade
25

 A masquerade takes place when one


entity pretends to be a different entity.

24 July 2017
Replay
 involves the passive capture of a data unit and
26

its subsequent retransmission to produce an


unauthorized effect.

24 July 2017
Modification of messages
27

 simply means that some portion of a legitimate


message is altered, or that messages are delayed or
reordered, to produce an unauthorized effect.

24 July 2017
Denial of service
28

 The denial of service prevents or inhibits the


normal use or management of communications
facilities.
 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.

24 July 2017
Security Services
29

1. Authentication
2. Access control
3. Data Confidentiality
4. Data Integrity
5. Non repudiation

24 July 2017
Security Services

 Authentication – assurance that the communicating entity is


who they say they are
 Access Control – prevent the unauthorized access to some
system resource
 Who can access

 Under what conditions

 What they are allowed to do

 Data Confidentiality – protection of data from unauthorized


disclosure
 Data Integrity – insure that data received is exactely what was
sent
 Nonrepudiation – protection from denial by one of the entities
involved in a communication of having participated in all or part
of the communication
Authentication
31

 To verify the identity of the user/computer .


 The assurance that the communicating entity is
one that it claims to be.
 Addresses masquerade and replay threats.
 Two specific authentication services:
 Peer entity Authentication
 Data Origin authentication

24 July 2017
Authentication
 Peer Entity Authentication – in a connection based
environment; provide confidence in the identity of a
connecting entity
 Logging in with a password
 Gaining access via biological identity verification
 DNA identification, retinal scan, finger/hand print
identification
 Access via audio voice identification
 Data Origin Authentication – in a connectionless
environment; provide assurance that the source of
received data is as claimed
 Corroborates the source of the data
 Does not proved assurance against duplicate or
modified data
Access Control
33

 To be able to tell who can do what with which


resource .
 Provides protection against unauthorized use of
resource, including:
 use of a communications resource,
 reading, writing or deletion of an information resource,
 execution of a processing resource.

24 July 2017
Data Confidentiality
34

 To keep a message secret to those that are not


authorized to read it
 Protection against unauthorized disclosure of
information.
 Four types:
 Connection confidentiality,
 Connectionless confidentiality,
 Selective field confidentiality,
 Traffic flow confidentiality.

24 July 2017
Data Confidentiality

 Connection Confidentiality
 Protection of all user data on a connection
 Connectionless Confidentiality
 Protection of all data within a single data block

 Selective-Field Confidentiality
 Insure confidentiality of selected fields with within
the user data on a connection or in a single data
block connection
 Traffic-Flow Confidentiality
 Protection of information that might be derived by
observing the traffic flow patterns
Data Integrity
36

 To make sure that a message has not been changed


while on Transfer, storage, etc .
 Often requires preventing unauthorized changes
 Includes data integrity (content) and origin integrity (source of
data also called authentication)
 Include prevention mechanisms and detection mechanisms
 Includes both correctness and trustworthiness
 Lost through unauthorized modification or destruction of
information

24 July 2017
Data Integrity

 Connection Integrity with Recovery


 Detect any modification of stream data or replay of data and retry;
 Connection Integrity without Recovery
 Detect any modification and report it, no retry…continue on
 Selective-Field Connection Integrity
 Same except for selected fields
 Connectionless Integrity
 Detect modifications in fixed block connectionless data, may provide
replay detection and protection
 Selective-Field Connectionless Integrity
 Same, except for selected fields
 Total stream protection would encompass all of the above and is
probably the best strategy
Nonrepudiation

 Nonrepudiation, Origin
 Proof that the message was sent by the
specified party
 Nonrepudiation, Destination
 Proof that the message was received by the
specified party
Non Repudiation
40

 To make sure that a user/server can’t deny


later having participated in a transaction
 Protects against a sender of data denying that data
was sent (non-repudiation of origin).
 Protects against a receiver of data denying that data
was received (non-repudiation of delivery).

24 July 2017
Security mechanisms
41

 feature designed to detect, prevent, or


recover from a security attack
 no single mechanism that will support all
services required
 however one particular element underlies many of
the security mechanisms in use: cryptographic
techniques

24 July 2017
42

 specific security mechanisms:


Encipherment, digital signatures, access controls, data
integrity, authentication exchange, traffic padding,
routing control, notarization
 pervasive security mechanisms:
trusted functionality, security labels, event
detection, security audit trails, security
recovery

24 July 2017
Security Mechanisms (X.800)

 Encipherment – algorithmic/mathematical conversion


 Digital Signature – appending a secret signature
 Access Control –
 Data Integrity
 Authentication Exchange
 Traffic Padding – appending extra chars to foil traffic
analysis techniques
 Routing Control – selection of secure routes through the
network
 Notarization – use a trusted 3rd party (like a notary public)
Other Security Mechanisms
(non X.800)

 Trusted Functionality
 That which is perceived to be true by some criteria (policy)
 Security Label
 The marking of (bound to) a resource that names or desiginates the
security attributes of the resource
 Event Detection
 Intrusion detection
 Detection of specific hacks (detector hardware)
 Too many log in attempts
 Security Audit Trail
 Logging of all system events
 Security Recovery
 Recovery based on requests from security mechanisms and/or event
handling.
Model for Network Security
45

24 July 2017
Model for Network Security
46

 using this model requires us to:


1. design a suitable algorithm for the security transformation
2. generate the secret information (keys) used by the
algorithm
3. develop methods to distribute and share the secret
information
4. specify a protocol enabling the principals to use the
transformation and secret information for a security
service

24 July 2017
Model for Network Access Security
47

24 July 2017
Model for Network Access Security
48

 using this model requires us to:


1. select appropriate gatekeeper functions to identify users
2. implement security controls to ensure only authorised
users access designated information or resources

24 July 2017
Symmetric Encryption
49

 or conventional / private-key / single-key


 sender and recipient share a common key
 all classical encryption algorithms are private-key
 was only type prior to invention of public-key in
1970’s
 and by far most widely used

24 July 2017
Some Basic Terminology
50

 plaintext - original message


 ciphertext - coded message
 cipher - algorithm for transforming plaintext to
ciphertext
 key - info used in cipher known only to sender/receiver
 encipher (encrypt) - converting plaintext to
ciphertext
 decipher (decrypt) - recovering ciphertext from
plaintext
 cryptography - study of encryption
principles/methods
 cryptanalysis (codebreaking) - study of principles/
methods of deciphering ciphertext without knowing
24 key
July 2017
Symmetric Cipher Model
51

24 July 2017
Requirements
52

 two requirements for secure use of symmetric


encryption:
 a strong encryption algorithm
 a secret key known only to sender / receiver
 mathematically have:
Y = E(K, X)
X = D(K, Y)
 assume encryption algorithm is known
 implies a secure channel to distribute key

24 July 2017
Cryptography
53

 can characterize cryptographic system by:


◦ type of encryption operations used
 substitution
 transposition
 product
◦ number of keys used
 single-key or private
 two-key or public
◦ way in which plaintext is processed
 block
 stream

24 July 2017
Cryptanalysis
54

 objective to recover key not just message


 general approaches:
 cryptanalytic attack

 brute-force attack

 if either succeed all key use compromised

24 July 2017
Cryptanalytic Attacks
➢ ciphertext only
55

 only know algorithm & ciphertext, is statistical, know or


can identify plaintext
➢ known plaintext
 know/suspect plaintext & ciphertext

➢ chosen plaintext
 select plaintext and obtain ciphertext

➢ chosen cipher text


 select cipher text and obtain plaintext

➢ chosen text
 select plaintext or cipher text to en/decrypt

24 July 2017
Brute Force Search
56

 always possible to simply try every key


 most basic attack, proportional to key
size
 assume either know / recognise
plaintext

24 July 2017
Classical Substitution Ciphers
57

 where letters of plaintext are replaced by other


letters or by numbers or symbols
 or if plaintext is viewed as a sequence of bits, then
substitution involves replacing plaintext bit patterns
with ciphertext bit patterns

24 July 2017
Caesar Cipher
58

 earliest known substitution cipher


 by Julius Caesar
 first attested use in military affairs
 replaces each letter by 3rd letter on
 example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB

24 July 2017
Caesar Cipher
59

 can define transformation as:


a b c d e f g h i j k l m n o p q r s t u v w x y z
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

 mathematically give each letter a number


a b c d e f g h i j k l m n o p q r s t u
v w x y z
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24 25

 then have Caesar cipher as:


c = E(k, p) = (p + k) mod (26)
p = D(k, c) = (c – k) mod (26)

24 July 2017
Cryptanalysis of Caesar Cipher
60

➢ only have 26 possible ciphers


 A maps to A,B,..Z

➢ could simply try each in turn


➢ a brute force search
➢ given ciphertext, just try all shifts of letters
➢ do need to recognize when have plaintext
➢ eg. break ciphertext "GCUA VQ DTGCM"

24 July 2017
Monoalphabetic Cipher
61

 rather than just shifting the alphabet


 could shuffle (jumble) the letters arbitrarily
 each plaintext letter maps to a different random
ciphertext letter
 hence key is 26 letters long

Plain: a b c d efg hijklmnopqrstuvwxyz


Cipher: DKVQ FIBJWPESCXHTMYAUOLRGZN

Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
24 July 2017
Language Redundancy and Cryptanalysis
62

➢ human languages are redundant


➢ eg "th lrd s m shphrd shll nt wnt"
➢ letters are not equally commonly used
➢ in English E is by far the most common letter
 followed by T,R,N,I,O,A,S

➢ other letters like Z,J,K,Q,X are fairly rare


➢ have tables of single, double & triple letter
frequencies for various languages

24 July 2017
English Letter Frequencies
63

24 July 2017

Here are the number of single letter occurrences in the encrypted text:
Here is the
A BC original
D E F G H Iencrypted
JKLMNOPQ text:
RSTUVWXY Z

18 3 7 35 0 2 14 14 22 26 13 0 25 39 38 12 3 7 1 14 0 21 3 19 15 41
OCDN NZHDIVM XJPMNZ 64 RDGG NOPYT
NZXPMDOT AMJH HPGODKGZ
KZMNKZXODQZNC RZ RDGG XJINDYZM
NJAORVMZ DHKGZHZIOVODJIN JA NZXPMDOT
MZGVOZY KJGDXDZN DI OCZ XJIOZSO JA
JKZMVODIB NTNOZHNA IZORJMFNA VIY
YVOVWVNZNC OJKDXN DIXGPYZO JKZMVODIB
NTNOZH KMJOZXODJI HZXCVIDNHNA
DIOMPNDJI YZOZXODJI NTNOZHNA AJMHVG
HJYZGN JA NZXPMDOTA XMTKOJBMVKCTA
YVOV WVNZ NZXPMDOTA RJMHNA QDMPNZNA
IZORJMF VIY YDNOMDWPOZY NTNOZH
NZXPMDOTA VIY KJGDXDZN JA KMDQVXT VIY
XJIADYZIODVGDOTC
24 July 2017
 First I guessed the word 'VIY' to be 'and'. The
frequency of 'Y' is65 small enough to be
substituted for 'd'.

 OCDN NZHDnaM XJPMNZ RDGG NOPdT NZXPMDOT


AMJH HPGODKGZ KZMNKZXODQZNC RZ RDGG
XJnNDdZM NJAORaMZ DHKGZHZnOaODJnN JA
NZXPMDOT MZGaOZd KJGDXDZN Dn OCZ XJnOZSO
JA JKZMaODnB NTNOZHNA
nZORJMFNA and daOaWaNZNC OJKDXN DnXGPdZO
JKZMaODnB NTNOZH KMJOZXODJn HZXCanDNHNA
DnOMPNDJn dZOZXODJn NTNOZHNA AJMHaG
HJdZGN JA NZXPMDOTA XMTKOJBMaKCTA daOa
WaNZ NZXPMDOTA RJMHNA QDMPNZNA nZORJMF
and dDNOMDWPOZd NTNOZH NZXPMDOTA and
KJGDXDZN JA KMDQaXT and XJnADdZnODaGDOTC

24 July 2017
66

 Next, the 'daOa' is assumed to be 'data'.


 tCDN NZHDnaM XJPMNZ RDGG NtPdT NZXPMDtT AMJH HPGtDKGZ
KZMNKZXtDQZNC RZ RDGG XJnNDdZM NJAtRaMZ
DHKGZHZntatDJnN JA NZXPMDtT MZGatZd KJGDXDZN Dn tCZ
XJntZSt JA JKZMatDnB NTNtZHNA nZtRJMFNA and dataWaNZNC
tJKDXN DnXGPdZt JKZMatDnB NTNtZH KMJtZXtDJn
HZXCanDNHNA DntMPNDJn dZtZXtDJn NTNtZHNA AJMHaG
HJdZGN JA NZXPMDtTA XMTKtJBMaKCTA data WaNZ NZXPMDtTA
RJMHNA QDMPNZNA nZtRJMF and dDNtMDWPtZd NTNtZH
NZXPMDtTA and KJGDXDZN JA KMDQaXT and XJnADdZntDaGDtTC

24 July 2017
67

 Z' is guessed to be 'e', based on its frequency.


 tCDN NeHDnaM XJPMNe RDGG NtPdT NeXPMDtT AMJH HPGtDKGe
KeMNKeXtDQeNC Re RDGG XJnNDdeM NJAtRaMe
DHKGeHentatDJnN JA NeXPMDtT MeGated KJGDXDeN Dn tCe
XJnteSt JA JKeMatDnB NTNteHNA netRJMFNA and dataWaNeNC
tJKDXN DnXGPdet JKeMatDnB NTNteH KMJteXtDJn HeXCanDNHNA
DntMPNDJn deteXtDJn NTNteHNA AJMHaG HJdeGN JA NeXPMDtTA
XMTKtJBMaKCTA data WaNe NeXPMDtTA RJMHNA QDMPNeNA
netRJMF and dDNtMDWPted NTNteH NeXPMDtTA and KJGDXDeN JA
KMDQaXT and XJnADdentDaGDtTC

24 July 2017
68

 'C' is guessed to be 'h', based on the 'tCe'.


 thDN NeHDnaM XJPMNe RDGG NtPdT NeXPMDtT AMJH HPGtDKGe
KeMNKeXtDQeNh Re RDGG XJnNDdeM NJAtRaMe
DHKGeHentatDJnN JA NeXPMDtT MeGated KJGDXDeN
Dn the XJnteSt JA JKeMatDnB NTNteHNA netRJMFNA and
dataWaNeNh tJKDXN DnXGPdet JKeMatDnB NTNteH KMJteXtDJn
HeXhanDNHNA DntMPNDJn deteXtDJn NTNteHNA AJMHaG HJdeGN
JA NeXPMDtTA XMTKtJBMaKhTA data WaNe NeXPMDtTA RJMHNA
QDMPNeNA netRJMF and dDNtMDWPted NTNteH NeXPMDtTA and
KJGDXDeN JA KMDQaXT and XJnADdentDaGDtTh

24 July 2017
69

 netRJMF' is guessed to be 'network'.


 thDN NeHDnar XoPrNe wDGG NtPdT NeXPrDtT AroH HPGtDKGe
KerNKeXtDQeNh we wDGG XonNDder NoAtware DHKGeHentatDonN
oA NeXPrDtT reGated KoGDXDeN Dn the XonteSt oA oKeratDnB
NTNteHNA networkNA and dataWaNeNh toKDXN DnXGPdet
oKeratDnB NTNteH KroteXtDon HeXhanDNHNA DntrPNDon
deteXtDon NTNteHNA AorHaG HodeGN oA NeXPrDtTA
XrTKtoBraKhTA data WaNe NeXPrDtTA worHNA
QDrPNeNA network and dDNtrDWPted NTNteH NeXPrDtTA and
KoGDXDeN oA KrDQaXT and XonADdentDaGDtTh

24 July 2017
70

 reGated' is guessed to be 'related'.


 thDN NeHDnar XoPrNe wDll NtPdT NeXPrDtT AroH HPltDKle
KerNKeXtDQeNh we wDll XonNDder NoAtware
DHKleHentatDonN oA NeXPrDtT related KolDXDeN Dn the
XonteSt oA oKeratDnB NTNteHNA networkNA and dataWaNeNh
toKDXN DnXlPdet oKeratDnB NTNteH KroteXtDon
HeXhanDNHNA DntrPNDon deteXtDon NTNteHNA AorHal
HodelN oA NeXPrDtTA XrTKtoBraKhTA data WaNe NeXPrDtTA
worHNA QDrPNeNA network and dDNtrDWPted NTNteH
NeXPrDtTA and KolDXDeN oA KrDQaXT and
XonADdentDalDtTh

24 July 2017
71

 'D' is guessed to be 'i', based on 'wDll' and 'Dn'.


 thiN NeHinar XoPrNe will NtPdT NeXPritT AroH HPltiKle
KerNKeXtiQeNh we will XonNider NoAtware iHKleHentationN oA
NeXPritT related KoliXieN in the XonteSt oA oKeratinB
NTNteHNA networkNA and dataWaNeNh toKiXN inXlPdet
oKeratinB NTNteH KroteXtion HeXhaniNHNA intrPNion
deteXtion NTNteHNA AorHal HodelN oA NeXPritTA
XrTKtoBraKhTA data WaNe NeXPritTA worHNA QirPNeNA
network and diNtriWPted NTNteH NeXPritTA and KoliXieN oA
KriQaXT and XonAidentialitTh

24 July 2017
72

 'NeHinar' is guessed to be 'seminar'.


 this seminar XoPrse will stPdT seXPritT Arom mPltiKle
KersKeXtiQesh we will Xonsider soAtware imKlementations oA
seXPritT related KoliXies in the XonteSt oA oKeratinB sTstemsA
networksA and dataWasesh toKiXs inXlPdet oKeratinB sTstem
KroteXtion meXhanismsA intrPsion deteXtion sTstemsA Aormal
models oA seXPritTA XrTKtoBraKhTA data Wase seXPritTA
wormsA QirPsesA network and distriWPted sTstem seXPritTA and
KoliXies oA KriQaXT and XonAidentialitTh

24 July 2017
73

 'XoPrse' is guessed to be 'course'. 'stPdT' is guessed to be 'study'.


'seXPritT' is guessed to be 'security'.
 this seminar course will study security from multiKle
KersKectiQesh we will consider software imKlementations of
security related Kolicies in the conteSt of oKeratinB systemsf
networksf and dataWasesh toKics includet oKeratinB system
Krotection mechanismsf intrusion detection systemsf formal
models of securityf cryKtoBraKhyf data Wase securityf wormsf
Qirusesf network and distriWuted system securityf and Kolicies of
KriQacy and confidentialityh

24 July 2017
74

 The final letters are filled in by scanning the text.


 this seminar course will study security from multiple
perspectives we will consider software implementations of
security related policies in the context of operating systemsf
networksf and databasesh topics includet operating system
protection mechanismsf intrusion detection systemsf formal
models of securityf cryptographyf data base securityf wormsf
virusesf network and distributed system securityf and
policies of privacy and confidentialityh

24 July 2017
Playfair Cipher
75

➢ not even the large number of keys in a


monoalphabetic cipher provides security
➢ one approach to improving security was to
encrypt multiple letters
➢ the Playfair Cipher is an example
➢ invented by Charles Wheatstone in 1854,
but named after his friend Baron Playfair

24 July 2017
Playfair Key Matrix
76

➢ To start, pick a keyword that does not contain any letter


more than once
➢ a 5X5 matrix of letters based on a keyword
➢ fill in letters of keyword (sans duplicates)
➢ fill rest of matrix with other letters
➢ eg. using the keyword MONARCHY
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
24 July 2017
Encrypting and Decrypting
77

 plaintext is encrypted two letters at a time


1. if a pair is a repeated letter, insert filler like 'X’
2. if both letters fall in the same row, replace each with letter
to right (wrapping back to start from end)
3. if both letters fall in the same column, replace each with the
letter below it (wrapping to top from bottom)
4. otherwise each letter is replaced by the letter in the same
row and in the column of the other letter of the pair

24 July 2017
Find the ciphertext
78
Key=Keyword
 “Why, don’t you?”

 “Come to the window.”

24 July 2017
79

 “Why, don’t you?”


 YI EA ES VK EZ

 “Come to the window.”


 LC NK ZK VF YO GQ CE BX

24 July 2017
Polyalphabetic Ciphers
80

 another approach to improving security is to use


multiple cipher alphabets
 called polyalphabetic substitution ciphers
 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

24 July 2017
Vigenère Cipher
81

 simplest polyalphabetic substitution cipher is the


Vigenère Cipher
 effectively multiple caesar ciphers
 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

24 July 2017
82

24 July 2017
Example
83

 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

24 July 2017
Example
84

 Keyword: RELAT IONS


 Plaintext: TO BE OR NOT TO BE TH AT IS THE
QUE STION

24 July 2017
Example
85

 Keyword: RELAT IONSR ELATI ONSRE LATIO


NSREL
 Plaintext: TO BE OR NOT TO BE
 TH AT IS THE QUE STION
 : KSMEH ZBBLK SMEMP OGAJX SEJCS FLZSY

24 July 2017
86

 Keyword: RELAT IONSR ELATI ONSRE LATIO


NSREL
 Ciphertext: KSMEH ZBBLK SMEMP OGAJX SEJCS
FLZSY
 Plaintext: TOBEO RNOTT OBETH ATIST HEQUE
STION

24 July 2017
One-Time Pad
87

 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
 problems in generation & safe distribution of key

24 July 2017
Encryption
88

H E L L O message
7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message +
23 (X) 12 (M) 2 (C) 10 (K) 11 (L) key
= 30 16 13 21 25
message + key = 4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z)
message + key (mod 26) E Q N V Z → ciphertext

24 July 2017
Decryption
89

EQNVZ
 ciphertext 4 (E) 16 (Q) 13 (N) 21 (V) 25 (Z)
ciphertext - 23 (X) 12 (M) 2 (C) 10 (K) 11 (L) key =
-19 4 11 11 14
 ciphertext – key = 7 (H) 4 (E) 11 (L) 11 (L) 14 (O)
 ciphertext – key (mod 26) H E L L O → message

24 July 2017
Hill Cipher
90

 The Hill Cipher uses matrix multiplication to encrypt


a message.
 First, you need to assign two numbers to each letter
in the alphabet and also assign numbers to space, . ,
and ? or !.
 The key space is the set of all invertible matrices over
Z26.
 26 was chosen because there are 26 characters,
which solves some problems later on.

24 July 2017
Hill Cipher example
91

Encryption:
Use the table and 00 for spaces:

A B C D E F G H I J K L M N O P Q R S
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
T U V W X Y Z
19 20 21 22 23 24 25

Consider the following message:

Herbert Yardley wrote The American Black


Chamber

24 July 2017
Hill Cipher example
Break the message into:
he rb er ty ar dl ey wr ot et he am er ic an bl ac
kc ha mb er

Now convert letters into number-pair:


8 5 18 2 5 18 20 25 1 18 4 12 5 25 23 18 15
20
5 20 8 5 1 13 5 18 9 3 1 14 2 12 1 3

03 07 
11 3 8 1 13 2 5 18
K  
 05 12 
Now using the matrix (key)
24 July 2017 92
Hill Cipher example
93

Make the first pair a column vector (h (8) e (5)),


and multiply that matrix by the key.
3 7  8  59 
5 12  5  100 
    

Of course, we need our result to be mod 26


 59   7 
100    22  mod 26
   

The ciphertext is G (7) V (22).


24 July 2017
Hill Cipher example
94

For the next pair r (18) b (2),


3 7  18 16 
5 12   2   10  mod 26
    

and 16 corresponds to P and 10 corresponds to J.

Do this for every pair and obtain


GVPJKGAJYMRHHMMSCCYEGVPEKGVCWQLXXOBMEZAKKG

24 July 2017
Transposition Ciphers
95

 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

24 July 2017
Rail Fence cipher
96

 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

24 July 2017
Example 1: Encipher “CHUCK NORRIS IS A
TOUGH GUY” using a rail fence cipher.
97

Solution:

24 July 2017
Note
98
To decipher a rail fence cipher, we divide the
ciphertext in half and reverse the order of the
steps of encipherment, that is, write the ciphertext
in two rows and read off the plaintext in a zig-zag
fashion.

24 July 2017
columnar Transposition Ciphers
99

 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.

24 July 2017
100

24 July 2017
101

24 July 2017
102

24 July 2017
Modern Block Ciphers
103

➢ now look at modern block ciphers


➢ one of the most widely used types of cryptographic
algorithms
➢ provide secrecy /authentication services
➢ focus on DES (Data Encryption Standard)
➢ to illustrate block cipher design principles

24 July 2017
Block vs Stream Ciphers
104

 block ciphers process messages in blocks, each of


which is then en/decrypted
 like a substitution on very big characters
 64-bits or more
 stream ciphers process messages a bit or byte at a
time when en/decrypting
 many current ciphers are block ciphers
 better analysed
 broader range of applications

24 July 2017
Block vs Stream Ciphers
105

24 July 2017
Block Cipher Principles
106

 most symmetric block ciphers are based on a


Feistel Cipher Structure
 needed since must be able to decrypt ciphertext to
recover messages efficiently
 block ciphers look like an extremely large
substitution
 would need table of 264 entries for a 64-bit block
 instead create from smaller building blocks
 using idea of a product cipher

24 July 2017
Ideal Block Cipher
107

24 July 2017
108

24 July 2017
Claude Shannon and Substitution-
Permutation
109 Ciphers
➢ Claude Shannon introduced idea of substitution-
permutation (S-P) networks in 1949 paper
➢ form basis of modern block ciphers
➢ S-P nets are based on the two primitive
cryptographic operations seen before:
 substitution (S-box)
 permutation (P-box)
➢ provide confusion & diffusion of message & key

24 July 2017
Confusion and Diffusion
110

 cipher needs to completely obscure statistical


properties of original message
 a one-time pad does this
 more practically Shannon suggested combining S &
P elements to obtain:
 diffusion – dissipates statistical structure of
plaintext over bulk of ciphertext
 confusion – makes relationship between ciphertext
and key as complex as possible

24 July 2017
Feistel Cipher Structure
111

 Horst Feistel devised the feistel cipher


 based on concept of invertible product cipher

 partitions input block into two halves


 process through multiple rounds which

 perform a substitution on left data half

 based on round function of right half & subkey

 then have permutation swapping halves

 implements Shannon’s S-P net concept

24 July 2017
One Feistel Round
112

The input to the round is Input Left Half Input Right Half
divided in half

Roundkey
The right half is put into a
round function with the
roundkey
Round
The output of the round
Function
function is XORed with the
left half

The two halves switch


sides to become the input
to the next round

Only the left half of the


input has been modified Output Left Half Output Right Half
24 July 2017
Mathematical Description of Each Round in the
Feistel Structure
113

24 July 2017
Feistel Cipher
114
Structure

24 July 2017
DES(Data Encryption Standard)
115

 The Data Encryption Standard (DES) is a symmetric-key


block cipher published by the National Institute of Standards
and Technology (NIST).

 In 1973, NIST published a request for proposals for a national


symmetric-key cryptosystem. A proposal from IBM, a
modification of a project called Lucifer, was accepted as DES.
DES was published in the Federal Register in March 1975 as a
draft of the Federal Information Processing Standard (FIPS).

24 July 2017
DES STRUCTURE
116

 The encryption process is made of two


permutations (P-boxes), which we call initial and
final permutations, and sixteen Feistel rounds.

24 July 2017
General structure of DES

117

24 July 2017
Initial and final permutation tables

118

24 July 2017
Encryption (Round)
119 (Key Generation)

24 July 2017
Expansion Table
120

24 July 2017
121

S-box

24 July 2017
S Box Table
122

24 July 2017
Permutation Table
123

24 July 2017
The DES Key Schedule: Generating the Round
Keys
124

 The initial 56-bit key may be represented as 8 bytes,


with the last bit (the least significant bit) of each byte
used as a parity bit.
 At the beginning of each round, we divide the 56
relevant key bits into two 28 bit halves and circularly
shift to the left each half by one or two bits,
depending on the round

24 July 2017
125

 For generating the round key, we join together the


two halves and apply a 56 bit to 48 bit contracting
permutation
 Permutation Choice 2, The resulting 48 bits
constitute our round key.

24 July 2017
126

24 July 2017
127

24 July 2017
Differential Cryptanalysis
128

Differential Cryptanalysis which analysis the


effect of particular difference in plaintext pairs an the
difference of the resultant cipher text pair. These
difference can be used to assign probabilities to the
possible keys and to locate the most probable key.

24 July 2017
Linear Cryptanalysis
129

 Linear cryptanalysis can break 16 round DES with


243plaintexts and complexity O(243) It is currently
the most effective attack against DES.

24 July 2017
130

24 July 2017
Comparison & important
131

features of modern symmetric


key algorithms

24 July 2017
Algorit Plaintext( Ciphertex Keysize Roun Advantage
hm Bits) t(bits) 132 ds
DES 64 bits 64 bits 56 bits 16 Simple and fast.
Less Mathematical
Calculation.
Cryptanalysis is difficult.
Triple 64 bits 64 bits 168 bits 48 des More reliable
DES round Easy to upgrade the
software 3 DES.
Longer Key length
difficult to encrypt
analyze.
AES 128 bits 128 bits 128/192/25 10/12 Longer Key length
6 bits /14 Supported.
More Flexible
Blowfis 64 bits 64 bits 32-448 bits 16 Fast and secure compact
h
RC5 32/64/128 32/64/128 0-2040 bits variab Simple and Fast
le Adaptable to the
processor of different
wavelength.
24 July 2017
Symmetric key crypto: DES
DES: Data Encryption Standard
 US encryption standard [NIST 1993]
 56-bit symmetric key, 64-bit plaintext input
 Block cipher with cipher block chaining
 How secure is DES?
 DES Challenge: 56-bit-key-encrypted phrase decrypted
(brute force) in less than a day
 No known good analytic attack
 making DES more secure:
 3DES: encrypt 3 times with 3 different keys
(actually encrypt, decrypt, encrypt)

133
Symmetric key
crypto: DES
DES operation
initial permutation
16 identical “rounds” of
function application,
each using different
48 bits of key
final permutation

134
AES: Advanced Encryption Standard
 new (Nov. 2001) symmetric-key NIST standard,
replacing DES
 processes data in 128 bit blocks
 128, 192, or 256 bit keys
 brute force decryption (try each key) taking 1 sec on
DES, takes 149 trillion years for AES

135

You might also like