Cs8792 Cns Unit 1
Cs8792 Cns Unit 1
NETWORK SECURITY
UNIT I
Prepared by
Dr. R. Arthy, AP/IT
Kamaraj College of Engineering and
Technology (Autonomous), Madurai.
Agenda
⚫ Security trends
⚫ Legal, Ethical and Professional Aspects of Security
⚫ Need for Security at Multiple levels, Security Policies
⚫ Security attacks, services and mechanism
⚫ OSI security architecture
⚫ Model of network security
Security Trends
Introduction
⚫ In 1994, the Internet Architecture Board (IAB) issued
a report entitled "Security in the Internet Architecture"
(RFC 1636).
⚫ Observations - Internet needs more and better security,
and it identified key areas for security mechanisms
⚫ Requirements
⚫ Need to secure the network infrastructure from
unauthorized monitoring and control of network traffic
⚫ Need to secure end-user-to-end-user traffic using
authentication and encryption mechanisms
⚫ Reported by the
Computer
Emergency
Response Team
(CERT)
Coordination Center
(CERT/CC).
⚫ Internet-related
vulnerabilities
Legal, Ethical, and Professional
Issues in Information Security
Law and Ethics in Information Security
⚫ Laws
⚫ Rules that mandate or prohibit certain behavior
⚫ Drawn from ethics
⚫ Ethics
⚫ Define socially acceptable behaviors
⚫ Key difference
⚫ Laws carry the authority of a governing body
⚫ Ethics do not carry the authority of a governing body
⚫ Based on cultural mores
⚫ Fixed moral attitudes or customs
⚫ Some ethics standards are universal
Organizational Liability and the Need for
Counsel
⚫ Liability
⚫ Legal obligation of organization
⚫ Due care
⚫ Organization makes sure that every employee knows what is acceptable or
unacceptable
⚫ Knows the consequences of illegal or unethical actions
Organizational Liability and the Need
for Counsel
⚫ Due diligence
⚫ Requires
⚫ Make a valid effort to protect others
⚫ Maintains the effort
⚫ Jurisdiction
⚫ Court’s right to hear a case if a wrong is committed
⚫ Term – long arm
⚫ Extends across the country or around the world
Policy Versus law
⚫ Policies
⚫ Guidelines that describe acceptable and unacceptable
employee behaviors
⚫ Functions as organizational laws
⚫ Has penalties, judicial practices, and sanctions
⚫ Difference between policy and law
⚫ Ignorance of policy is acceptable
⚫ Ignorance of law is unacceptable
⚫ Keys for a policy to be enforceable
⚫ Dissemination
⚫ Review
⚫ Comprehension
⚫ Compliance
⚫ Uniform enforcement
Types of Law
⚫ Civil – govern a nation or state
public
⚫ Private – encompasses family, commercial, labor, and
business globally
⚫ Information exchange
⚫ Education development
⚫ Focus – “promoting management practices that will ensure the confidentiality, integrity, and
⚫ Examination of vulnerabilities
⚫ Maintains a secure Web site for communication about suspicious activity or intrusions
⚫ U. S. Secret Service
required
owned by an organization
security requirements
communication
⚫ denial of service
Model for Network Security
Model for Network Security
⚫ using this model requires us to:
D N E T L
* * * * * * * * *
* * * * *
[contd…]
D N E T L
E E D H E S W L X
* * * * *
D N E T L
E E D H E S W L X
F T A A X
Cipher Text
"ALNISESTITPIMROOPASN"
Encryption
The message is written out in rows of a fixed length, and
then read out again column by column, and the columns
are chosen in some scrambled order.
Width of the rows and the permutation of the columns are
usually defined by a keyword.
For example, the word HACK is of length 4 (so the rows
are of length 4), and the permutation is defined by the
alphabetical order of the letters in the keyword. In this case,
the order would be “3 1 2 4”.
Any spare spaces are filled with nulls or left blank or
placed by a character (Example: _).
Finally, the message is read off in columns, in the order
specified by the keyword.
Example
Plain Text - "The tomato
is a plant in the nightshade
family“
Keyword - tomato
Cipher Text -
"TINESAXEOAHTFXHT
LTHEYMAIIAIXTA
PNGDLOSTNHMX".
Decryption
To decipher it, the recipient has to work out the
column lengths by dividing the message length by the
key length.
Then, write the message out in columns again, then re-
order the columns by reforming the key word.
Example
Cipher Text -
"TINESAXEOAHTFXHTLTHEYMAIIAIXTA
PNGDLOSTNHMX".
Keyword - tomato
Number of rows = length(cipher text)/length(keyword)
= 42 / 6
=7
[contd…]
T O M A T O T O M A T O
5 3 2 1 6 4 5 3 2 1 6 4
X
[contd…]
T O M A T O T O M A T O
5 3 2 1 6 4 5 3 2 1 6 4
E T H E T
O I T O I
A N L A N
H E T H E
T S H T S
F A E F A
X X Y X X
[contd…]
T O M A T O T O M A T O
5 3 2 1 6 4 5 3 2 1 6 4
H E T M T H E T M
T O I A A T O I A
L A N I P L A N I
T H E I N T H E I
H T S A G H T S A
E F A I D E F A I
Y X X X L Y X X X
[contd…]
Plain Text - "The tomato T O M A T O
is a plant in the nightshade 5 3 2 1 6 4
family“
T H E T O M
A T O I S A
P L A N T I
N T H E N I
G H T S H A
D E F A M I
L Y X X X X
CRYPTOGRAPHY AND
NETWORK SECURITY
Classical Encryption Algorithms
17.08.2020
Algorithms
Substitution
Caesar Cipher
Shift Cipher
Playfair Cipher
Vigenere Cipher
Auto Key Cipher
One Time Pad
Hill Cipher
Affine Cipher
Transposition
Rail Fence
Row Columnar Transposition
Introduction
In a transposition cipher, the order of the alphabets is
re-arranged to obtain the cipher-text.
A simple form of Rail Fence
Plain Text – defend the east wall
Key - 2
Encryption
In the rail fence cipher, the plain-text is written
downwards and diagonally on successive rails of an
imaginary fence.
When we reach the bottom rail, we traverse upwards
moving diagonally, after reaching the top rail, the
direction is changed again. Thus the alphabets of the
message are written in a zig-zag manner.
After each alphabet has been written, the individual
rows are combined to obtain the cipher-text.
Example
Plain Text – defend the east wall
Key – 3
D N E T L
* * * * * * * * *
* * * * *
[contd…]
D N E T L
E E D H E S W L X
* * * * *
D N E T L
E E D H E S W L X
F T A A X
Cipher Text
"ALNISESTITPIMROOPASN"
Encryption
The message is written out in rows of a fixed length, and
then read out again column by column, and the columns
are chosen in some scrambled order.
Width of the rows and the permutation of the columns are
usually defined by a keyword.
For example, the word HACK is of length 4 (so the rows
are of length 4), and the permutation is defined by the
alphabetical order of the letters in the keyword. In this case,
the order would be “3 1 2 4”.
Any spare spaces are filled with nulls or left blank or
placed by a character (Example: _).
Finally, the message is read off in columns, in the order
specified by the keyword.
Example
Plain Text - "The tomato
is a plant in the nightshade
family“
Keyword - tomato
Cipher Text -
"TINESAXEOAHTFXHT
LTHEYMAIIAIXTA
PNGDLOSTNHMX".
Decryption
To decipher it, the recipient has to work out the
column lengths by dividing the message length by the
key length.
Then, write the message out in columns again, then re-
order the columns by reforming the key word.
Example
Cipher Text -
"TINESAXEOAHTFXHTLTHEYMAIIAIXTA
PNGDLOSTNHMX".
Keyword - tomato
Number of rows = length(cipher text)/length(keyword)
= 42 / 6
=7
[contd…]
T O M A T O T O M A T O
5 3 2 1 6 4 5 3 2 1 6 4
X
[contd…]
T O M A T O T O M A T O
5 3 2 1 6 4 5 3 2 1 6 4
E T H E T
O I T O I
A N L A N
H E T H E
T S H T S
F A E F A
X X Y X X
[contd…]
T O M A T O T O M A T O
5 3 2 1 6 4 5 3 2 1 6 4
H E T M T H E T M
T O I A A T O I A
L A N I P L A N I
T H E I N T H E I
H T S A G H T S A
E F A I D E F A I
Y X X X L Y X X X
[contd…]
Plain Text - "The tomato T O M A T O
is a plant in the nightshade 5 3 2 1 6 4
family“
T H E T O M
A T O I S A
P L A N T I
N T H E N I
G H T S H A
D E F A M I
L Y X X X X
Algorithms
Substitution
Caesar Cipher
Shift Cipher
Playfair Cipher
Vigenere Cipher
Auto Key Cipher
One Time Pad
Hill Cipher
Affine Cipher
Transposition
Rail Fence
Row Columnar Transposition
Affine Cipher
The Affine Cipher is another example of a
Monoalphabetic Substitution cipher.
Encryption
C = (aP + b) mod 26
where a and b are the key for the cipher.
Decryption
P = a-1(C - b) mod 26
a x a-1 = 1 mod 26
Example - Encryption
Plain text c o o l
2 14 14 11
5P + 8 18 78 78 63
(5P + 8)mod 26 18 0 0 11
Cipher text S A A L
Example - Decryption
Encryption Steps:
Step 1: Key Generation
Step 2: Encryption Process
STEP 1: KEY GENERATION
Key Size: 5 X 5
Key representation: matrix
Encryption Steps:
Encryption Steps:
Idea:
Choose a short key K randomly.
Obtain K’=G(K).
Use K’ as key for the one time pad.
Issue:
Such a generator is not possible!
Any such generator produces a longer string but the string is not random.
[CONTD…]
What if there is a generator that produces strings that ―appear
to be random‖. The bits are pseudorandom.
General idea: The bits are not really random but they are as
good as random so we‘ll just use them for our purpose.
Argue that if there is an adversary that breaks the protocol (our one
time pad), then the bit string produced by G is not really
pseudorandom.
ATTACKS
Ciphertext only
Known plaintext
Chosen plaintext
Chosen ciphertext
PERFECT SECRECY - BASIC CONCEPTS
Let P, K and C be sets of plaintexts, keys and cryptotexts.
Let pK(k) be the probability that the key k is chosen from K and let a priory
probability that plaintext w is chosen is pp(w).
k K, C k ek w | w P
If for a key , then for the probability PC(y) that c is
the cryptotext that is transmitted it holds
pC c p k p d c.
K P k
k |cC k
For the conditional probability pc(c|w) that c is the cryptotext if w is the plaintext it
holds
pC c | w p k . K
k |w d k c
(That is, the a posteriori probability that the plaintext is w,given that the cryptotext is c
is obtained, is the same as a priori probability that the plaintext is w.)
Example CAESAR cryptosystem has perfect secrecy if any of the26 keys is used with
the same probability to encode any symbol of the plaintext.
PERFECT SECRECY - BASIC RESULTS
An analysis of perfect secrecy: The condition pP(w|c) = pP(w) is for all wP and cC
equivalent to the condition pC(c|w) = pC(c).
Fix wP. For each cC we have pC(c|w) = pC(c) > 0. Hence, for each c€C there must
exists at least one key k such that ek(w) = c. Consequently, |K| >= |C| >= |P|.
In a special case |K| = |C| = |P|. the following nice characterization of the perfect secrecy
can be obtained:
Theorem A cryptosystem in which |P| = |K| = |C| provides perfect secrecy if and only if
every key is used with the same probability and for every wP and every c€C there is a
unique key k such that ek(w) = c.
CRYPTOGRAPHY AND NETWORK
SECURITY
Product Cryptosystem
11.09.2020
PRODUCT CRYPTOSYSTEMS
A cryptosystem S = (P, K, C, e, d) with the sets of plaintexts P, keys K and cryptotexts C
and encryption (decryption) algorithms e (d) is called endomorphic if P = C.
If S1 = (P, K1, P, e(1), d (1)) and S2 = (P, K2, P, e (2), d (2)) are endomorphic cryptosystems,
then the product cryptosystem is
A spy group received info about the arrival of a new member. Thesecret police succeeded in
learning the message and knew that it wasencrypted using the HILL cryptosystem with a
matrix of degree 2. It also learned that the code ``10 3 11 21 19 5'' stands for the name ofthe
spy and ``24 19 16 19 5 21'', for the city, TANGER, the spy should come from. What is the
name of the spy?
Decrypt the following cryptotexts. (Not all plaintexts are in English.)
- WFLEUKZFEKZFEJFWTFDGLKZEX
- DANVHEYD SEHHGKIIAJ VQN GNULPKCNWLDEA
- DHAJAHDGAJDI AIAJ AIAJDJEH DHAJAHDGAJDI AIDJ AIBIAJDJ\DHAJAHDGAJDI AIAJ
DIDGCIBIDH DHAJAHDGAJDI AIAJ DICIDJDH
- KLJPMYHUKV LZAL ALEAV LZ TBF MHJPS
Find the largest possible word in Czech language such that its nontrivial encoding by CAESAR
is again a meaningful Czech word.
Find the longest possible meaningful word in a European language such that some of its non-
trivial encoding by CAESAR is again ameaningful word in a European language (For example:
e3(COLD) = FROG).
EXERCISES IV
Decrypt the following cryptotext obtained by encryption with an AFFINE
cryptosystem:
KQEREJEBCPPCJCRKIEACUZBKRVPKRBCIBQCARBJCVFCUPKRIOFKPACUZQEPBKR
XPEIIEABDKPBCPFCDCCAFIEABDKPBCPFEQPKAZBKRHAIBKAPCCIBURCCDKDCCJ
CIDFUIXPAFFERBICZDFKABICBBENEFCUPJCVKABPCYDCCDPKBCOCPERKIVKSCPI
CBRKIJPKAI
Suppose we are told that the plaintext ―FRIDAY'' yields the cryptotext ―PQCFKU''
with a HALL cryptosystem. Determine the encryption matrix.
Suppose we are told that the plaintext ―BREATHTAKING‖' yieldsthe cryptotext
―RUPOTENTOSUP'' with a HILL cryptosystem. Determine the encryption matrix.
Decrypt the following cryptotext, obtained using the AUTOKLAVE cryptotext (using
exhaustive search ?)
MALVVMAFBHBUQPTSOXALTGVWWRG
Design interesting cryptograms in (at least) one of the languages: Czech, French,
Spanish, Chines?
Show that each permutation cryptosystem is a special case of the HILL cryptosystem.
How many 2 × 2 matrices are there that are invertible over Zp, where p is a prime.
Invent your own interesting and quite secure cryptosystem.
CRYPTOGRAPHY AND NETWORK
SECURITY
Cryptanalysis
11.09.2020
CIA
Confidentiality,Integrity and Availability
Confidentiality: prevent unauthorized reading of
29
Intro
information
Integrity: prevent unauthorized writing of
information
Availability: data is available in a timely manner
when needed
Availability is a ―new‖ security concern
Due to denial of service (DoS) threats
CRYPTO
Cryptology The art and science of making and breaking
―secret codes‖
30
Intro
Cryptography making ―secret codes‖
31
Intro
We decrypt ciphertext to recover plaintext
A key is used to configure a cryptosystem
A symmetric key cryptosystem uses the same key
to encrypt as to decrypt
A public key cryptosystem uses a public key to
encrypt and a private key to decrypt
Private key can be used to sign and public key used to
verify signature (more on this later…)
CRYPTO
Underlying assumption
The system is completely known to Trudy
32
Intro
Only the key is secret
Also known as Kerckhoffs Principle
Crypto algorithms are not secret
Why do we make this assumption?
Experience has shown that secret algorithms are often
weak when exposed
Secret algorithms never remain secret
Better to find weaknesses beforehand
CRYPTO AS A BLACK BOX
key key
33
Intro
Pi Ci Pi
plaintext encrypt decrypt plaintext
ciphertext
34
Intro
Pi Ci Pi
plaintext encrypt decrypt plaintext
ciphertext
35
Intro
Stream ciphers and block ciphers
Public Key
Two keys, one for encryption (public), and one for
decryption (private)
Digital signatures nothing comparable in symmetric
key crypto
Hash algorithms
CRYPTANALYSIS
36
Intro
Trudy is not bound by any rules
For example, Trudy might attack the implementation, not the
algorithm itself
She might use ―side channel‖ info, etc.
EXHAUSTIVE KEY SEARCH
How can Trudy attack a cipher?
She can simply try all possible keys and test
37
Intro
each to see if it is correct
Exhaustive key search
Toprevent an exhaustive key search, a
cryptosystem must have a large keyspace
Must be too many keys for Trudy to try them all in
any reasonable amount of time
BEYOND EXHAUSTIVE SEARCH
38
Intro
But a large keyspace is not sufficient
39
Intro
Chosen plaintext
―Lunchtime attack‖
Protocols might encrypt chosen text
40
Intro
all possible keys
Cryptosystem is insecure if any shortcut attack is known
41
Intro
The size of the keyspace is the ―advertised‖
level of security
If an attack requires less work, then false
advertising
A cipher must be secure (by our definition) and
have a ―large‖ keyspace
Too big for an exhaustive key search
THEORETICAL CRYPTANALYSIS
Suppose that a cipher has a 100 bit key
Then keyspace is of size 2100
42
Intro
On average, for exhaustive search Trudy tests 2100/2 = 299
keys
Suppose Trudy can test 230 keys/second
Then she can find the key in about 37.4 trillion years
THEORETICAL CRYPTANALYSIS
Suppose that a cipher has a 100 bit key
Then keyspace is of size 2100
43
Intro
Suppose there is a shortcut attack with ―work‖ equal to
testing about 280 keys
If Trudy can test 230 per second
Then she finds key in 36 million years
Better than 37 trillion, but not practical
APPLIED CRYPTANALYSIS
In this class, we focus on attacks that produce plaintext
Not interested in attacks that just show a theoretical weakness
44
Intro
in a cipher
We call this applied cryptanalysis
Why applied cryptanalysis?
Because it‘s a lot more fun…
And it‘s a good place to start
APPLIED CRYPTANALYSIS: OVERVIEW
Classic (pen and paper) ciphers
Transposition, substitution, etc.
45
Intro
Same principles appear in later sections
46
Intro
Hash functions
Nostradamus attack, MD4, MD5
Public key crypto
Knapsack, Diffie-Hellman, Arithmetica, RSA, Rabin, NTRU,
ElGamal
Factoring, discrete log, timing, glitching
WHY STUDY CRYPTOGRAPHY?
Information security is a big topic
Crypto, Access control, Protocols, Software
47
Intro
Real world info security problems abound
Cryptography is the part of information security
that works best
Using crypto correctly is important
48
Intro
Gain insight into attacker‘s mindset
―black hat‖ vs ―white hat‖ mentality
Cryptanalysis is more fun than cryptography
Cryptographers are boring
Cryptanalysts are cool
But cryptanalysis is hard
QUESTION 1
Caesar wants to arrange a secret meeting with Antony,
either at the Tiber (the river) or at the Coliseum (the
arena). He sends the cipher text EVIRE. However,
Antony does not know the key, so he tries all
possibilities. Where will he meet Caesar?
QUESTION 2
Using this Playfair matrix
Encrypt the message:
―Must see you over Cadogan West, Coming
at once‖
M F H I/J K
U N O P Q
Z V W X Y
E L A R G
D S T B C
QUESTION 3
Decipher the message, YIFZMA using the Hill cipher
with the inverse key.
9 13
2 3
QUESTION 4
Encrypt the message ―PAY‖ using hill cipher with the
following key matrix and show the decryption to get
original plain text.
17 17 5
21 18 21
2 2 19