Cryptography and Network Security
Cryptography and Network Security
Network Security
MODULE 1
24 July 2017
CRYPTOGRAPHY
2
24 July 2017
CRYPTOGRAPHY
3
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
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
Availability
Ability to use information or resources
24 July 2017
The Need for Security
8
24 July 2017
Aspects of Network Security
9
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
24 July 2017
15
24 July 2017
Security attacks
16
24 July 2017
17
24 July 2017
Security attacks
18
24 July 2017
19
24 July 2017
20
24 July 2017
Security attacks 21
24 July 2017
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
24 July 2017
Masquerade
25
24 July 2017
Replay
involves the passive capture of a data unit and
26
24 July 2017
Modification of messages
27
24 July 2017
Denial of service
28
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
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
24 July 2017
Data Confidentiality
34
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
24 July 2017
Data Integrity
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
24 July 2017
Security mechanisms
41
24 July 2017
42
24 July 2017
Security Mechanisms (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
24 July 2017
Model for Network Access Security
47
24 July 2017
Model for Network Access Security
48
24 July 2017
Symmetric Encryption
49
24 July 2017
Some Basic Terminology
50
24 July 2017
Requirements
52
24 July 2017
Cryptography
53
24 July 2017
Cryptanalysis
54
brute-force attack
24 July 2017
Cryptanalytic Attacks
➢ ciphertext only
55
➢ chosen plaintext
select plaintext and obtain ciphertext
➢ chosen text
select plaintext or cipher text to en/decrypt
24 July 2017
Brute Force Search
56
24 July 2017
Classical Substitution Ciphers
57
24 July 2017
Caesar Cipher
58
24 July 2017
Caesar Cipher
59
24 July 2017
Cryptanalysis of Caesar Cipher
60
24 July 2017
Monoalphabetic Cipher
61
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
24 July 2017
Language Redundancy and Cryptanalysis
62
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'.
24 July 2017
66
24 July 2017
67
24 July 2017
68
24 July 2017
69
24 July 2017
70
24 July 2017
71
24 July 2017
72
24 July 2017
73
24 July 2017
74
24 July 2017
Playfair Cipher
75
24 July 2017
Playfair Key Matrix
76
24 July 2017
Find the ciphertext
78
Key=Keyword
“Why, don’t you?”
24 July 2017
79
24 July 2017
Polyalphabetic Ciphers
80
24 July 2017
Vigenère Cipher
81
24 July 2017
82
24 July 2017
Example
83
24 July 2017
Example
84
24 July 2017
Example
85
24 July 2017
86
24 July 2017
One-Time Pad
87
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
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
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
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
24 July 2017
Transposition Ciphers
95
24 July 2017
Rail Fence cipher
96
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
24 July 2017
100
24 July 2017
101
24 July 2017
102
24 July 2017
Modern Block Ciphers
103
24 July 2017
Block vs Stream Ciphers
104
24 July 2017
Block vs Stream Ciphers
105
24 July 2017
Block Cipher Principles
106
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
24 July 2017
Feistel Cipher Structure
111
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
24 July 2017
Feistel Cipher
114
Structure
24 July 2017
DES(Data Encryption Standard)
115
24 July 2017
DES STRUCTURE
116
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
24 July 2017
125
24 July 2017
126
24 July 2017
127
24 July 2017
Differential Cryptanalysis
128
24 July 2017
Linear Cryptanalysis
129
24 July 2017
130
24 July 2017
Comparison & important
131
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