CH 1
CH 1
3
Cont…
• Computer Security - generic name for the collection
of tools designed to protect data and to trace
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
• information security is about how to prevent
attacks, or failing that, to detect attacks on
information-based systems
Primary Goals of security is
C.I.A. triangle was standard that tells the primary goals of
information security
5
Security Trends
Aspects of Security
• consider 3 aspects of information security:
– security attack
– security mechanism
– security service
Security Attack
8
Attacks (continued)
• Denial-of-service (DoS): attacker sends large
number of connection or information requests
to a target
– Target system cannot handle successfully along with
other, legitimate service requests
– May result in system crash or inability to perform
ordinary functions
• Distributed denial-of-service (DDoS):
coordinated stream of requests is launched
against target from many locations
simultaneously 9
Figure 2-9 - Denial-of-Service
Attacks
10
Attacks (continued)
• Ip Spoofing attack: technique used to gain
unauthorized access; intruder assumes a
trusted IP address
11
Fig 1.3 Ip spoofing
12
Figure 2-11 - Man-in-the-Middle
16
2.Passive Attacks:
• 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.
17
Difference between passive and active attacks
18
• Cont…
19
Security Service
– enhance security of data processing systems and
information transfers of an organization
– intended to counter security attacks
– using one or more security mechanisms
– often replicates functions normally associated
with physical documents
• which, for example, have signatures, dates; need
protection from disclosure, tampering, or destruction;
be notarized or witnessed; be recorded or licensed
Security Services
• X.800:
“a service provided by a protocol layer of
communicating open systems, which ensures
adequate security of the systems or of data
transfers”
• RFC 2828:
“a processing or communication service provided by
a system to give a specific kind of protection to
system resources”
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
Security Mechanism
• 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
• hence our focus on this topic
Security Mechanisms (X.800)
• specific security mechanisms:
– encipherment
– digital signatures
– access controls
– data integrity
– authentication exchange
– traffic padding
Model for Network Security
Some Basic Terminology
26
Cryptanalysis
• objective to recover key not just message
• general approaches:
– cryptanalytic attack
– brute-force attack
Cryptanalytic Attacks
• ciphertext only
– 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 ciphertext
– select ciphertext and obtain plaintext
• chosen text
– select plaintext or ciphertext to en/decrypt
conventional / Symmetric /private-key/
single-key/ cryptographic algorithm
29
Symmetric Cipher Model
30
1.Classical encryption technique
• There are two primary methods in which plain
text can be converted into cypher text and vice
versa
a. Substitution: letters of plaintext are replaced by
other letters or by numbers or symbols
b. Transposition: performing permutation in order
to change the plain text to cipher text.
Thus, these two methods are called as classical
cryptography techniques
31
a) Substitution Ciphers
• 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
cipher text bit patterns
example: i) Caesar cipher
ii) Monoalphabetic Cipher
iii)Playfair Cipher
iv)Hill Cipher
v)polyalphabetic Cipher
Vi ) one time pad
32
i)Caesar Cipher
• 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
33
Caesar Cipher
• 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
34
Cryptanalysis of Caesar Cipher
• only have 26 possible ciphers
– A maps to A,B,..Z
• could simply try each in turn
• a brute force search
• given cipher text, just try all shifts of letters
• do need to recognize when have plaintext
• eg. break ciphertext "GCUA VQ DTGCM"
ii) Monoalphabetic Cipher
• rather than just shifting the alphabet
• Permute the letters arbitrarily
• each plaintext letter maps to a different random
ciphertext letter
• hence key is 26 letters long
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
Monoalphabetic Cipher Security
• If S=[a,b,c]
• s have 6 permituation
• (abc,acb,bac,bca,cab,cba)
3!=6
• now have a total of 26! = 4 x 1026 keys
• with so many keys, might think is secure
• but would be !!!WRONG!!!
• problem is language characteristics
Language Redundancy and Cryptanalysis
42
Playfair Key Matrix
• 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
43
Encrypting and Decrypting
• 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 (again 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
44
Playfair Cipher (cont…)
Example
use key playfir to encrypt the message (meet at the
school house)
p l a y f
Ij r b c d
e g h k m
n o q s t
u v w x z
45
iV) Hill Cipher
Invented in 1929 by Lester Hill, the Hill Cipher uses blocks of m characters for some
integer m, and enciphers elements by means of linear combinations of the m elements.
Let P = C = (Z26)m and let K be the set of invertible mm matrices over Z26.
In the above, we have identified the letters of the alphabet with the corresponsing
integers as before.
We shall henceforth assume this correspondence and treat Z26 as if it were the
alphabet.
However, from time to time, we will elaborate to remind you of the real process.
46
The Hill Cipher
So how do we decrypt?
Then we would compute the matrix inverse and multiply both sides by the inverse
dM(y) = yM-1
47
The Hill Cipher
Example: encrypt the plaintext july using the Hill cipher with m = 2 and key
11 8
3 7
7 18
As noted above,
23 11
11 8
9, 20 99 60,72 140 3,4 DE
3 7
11 8
11, 22 121 72,88 168 11,22 LW
3 7
7 18
3, 4 9,20 ju
23 11
7 18
11, 22 11,24 ly
23 11
V. Polyalphabetic
Ciphers
The monoalphabetic (simple) substitution cipher uses
only one replacement scheme for all letters of the plain
text. Polyalphabetic ciphers use more than one
replacement scheme.
•improve security using multiple cipher alphabets(use of
multiple letters to replace one letter)
•make cryptanalysis harder with more alphabets to guess
and flatter frequency distribution
•one of the simplest, polyalphabetic ciphers is the
Vigenère cipher.
50
Vigenere Cipher
51
vi.One-Time Pad
• This technique was introduced by army signal
officer Joseph Mauborgne. Which is also called
Vernam.
• He suggested using a random key that is as long
as the message.
• A message encrypted using a one-time pad
cannot be broken because the encryption key is a
random number and because the key is used
only once
• problems in generation & safe distribution of key
2)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
examples i. Rail Fence cipher
ii. Columnar Transposition 53
i. Rail Fence cipher
• write message letters out diagonally over a number
of rows
• then read off cipher row by row
• For example, to encipher the message
“meet me after the toga party” with a rail fence of
depth 2, we write
• 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
54
Decryption
• The decryption process for the Rail Fence Cipher
involves reconstructing the diagonal grid used to
encrypt the message. We start writing the
message, but leaving a dash in place of the
spaces yet to be occupied. Gradually, you can
replace all the dashes with the corresponding
letters, and read off the plaintext from the table.
• We start by making a grid with as many rows as
the key is, and as many columns as the length of
the ciphertext.
Cont..
• We then place the first letter in the top left square, and
dashes diagonally downwards where the letters will be.
When we get back to the top row, we place the next
letter in the ciphertext. Continue like this across the row,
and start the next row when you reach the end.
• For example, if you receive the ciphertext
"TEKOOHRACIRMNREATANFTETYTGHH", encrypted with
a key of 4, you start by placing the "T" in the first square.
You then dash the diagonal down spaces until you get
back to the top row, and place the "E" here. Continuing
to fill the top row you get the pattern below.
Cont..
Cont…
From this we can now read the plaintext off
following the diagonals to get "they are attacking
from the north".
ii. Columnar Transposition
A more complex scheme is to write the message in a rectangle, row by row,
and read the message off, column by column, but to permute the order of
columns. The order of columns then becomes the key to the algorithm. For
Example, a t t a c k p o s t p o n e d u n t i l t w o month
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 m o n t h
Ciphertext: TTNMAPTOTSUOAODWCOINKNLTPETH
A pure transposition cipher is easily recognized because it has the same letter
frequencies as the original plaintext.
59
Rotor Machines
• before modern ciphers, rotor machines were most
common complex ciphers in use
• widely used in WW2
– German Enigma, Allied Hagelin, Japanese Purple
• implemented a very complex, varying substitution
cipher
• used a series of cylinders, each giving one
substitution, which rotated and changed after each
letter was encrypted
• with 3 cylinders have 263=17576 alphabets
Cont…
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 graphic image or sound file
• has drawbacks
– high overhead to hide relatively few info bits
62