Ns 1
Ns 1
▪ Introduction
▪ Security Objectives
▪ OSI Security Architecture
▪ Security Attacks
▪ Security Services
▪ Security Mechanism
▪ Symmetric Cipher Model
▪ Cryptography
▪ Cryptanalysis and Attacks
▪ Substitution and Transposition Techniques
Introduction to Information & N/W Security
Information & Network Security
▪ What is Information ?
• The processed form of data or meaningful data is
called information. Basically, information is the message that is
being conveyed.
▪ What is Security ?
1. Computer Security : Generic name for the collection of tools
designed to protect data.
2. Network and Internet Security : Measures to protect data
during their transmission over a collection of interconnected
networks.
Key Security Objectives
▪ Goal/Objectives of Security :
1. Confidentiality
2. Integrity
3. Availability
4. Authenticity
5. Accountability
Confidentiality
1. Confidentiality:
• Data confidentiality: Assure confidential information not made
available to unauthorized individuals.
Example : Individual files are locked and secured
Bob
Alice
Attacker
Confidentiality
• Privacy: Assure individuals can control what information related
to them is collected, stored, distributed.
• Privacy is the right of an individual to protect personal or
sensitive information.
Integrity
2. Integrity :
• Data integrity: Assure information and programs are changed
only in a authorized manner.
Message
Bob
Alice
Modifies the message, Message
or Inserts a new one.
Attacker
Integrity
• System integrity: Assure system performs intended function.
Availability
3. Availability :
• Assure that systems work promptly and service is not denied
to authorized users.
www.amazon.com
User
Browser working Server down
Authenticity
4. Authenticity:
• The property of being genuine and being able to be verified
and trusted; confidence in the validity of a transmission, a
message, or message originator.
• This means verifying that each input arriving at the system
came from a trusted source.
User A
Bank
User C
Accountability
5. Accountability:
• The security goal that generates the requirement for actions of
an entity to be traced uniquely to that entity.
• This supports nonrepudiation(assurance that someone cannot
deny something).
Transfer Rs.
1,00,000
User A to Bank
Bank
Impact of Security Breaches
▪ Effectiveness of primary operations are reduced
• Example: Hackers compromised exam question paper.
▪ Financial loss
• Example: The cost of repairing a company database once it’s
been compromised.
▪ Damage to assets
• Example: Hackers compromised Amazon Web Services account
and demanded a ransom. When the company declined, the
hacker started destroying their resources.
▪ Harm to individuals
• Example: Hackers compromised patience database and change
it.
OSI Security Architecture
▪ Systematic approach to define requirements for security and
approaches to satisfying those requirements
▪ The OSI (Open Systems Interconnection) security architecture
focuses on Security Attacks, Mechanisms, and Services.
▪ Security Attack: Any action that compromises the security of
information owned by an organization.
▪ Security Mechanism: A process that is designed to detect,
prevent, or recover from a security attack.
▪ Security Service: A communication service that enhances the
security of the data processing systems and the information
transfers of an organization.
Security Attacks
Security Attacks
▪ A passive attack attempts to learn or make use of information
from the system but does not affect system resources.
1. Release of message contents
2. Traffic analysis
▪ Relatively hard to detect, but easier to prevent
▪ An active attack attempts to alter system resources or affect their
operation.
1. Masquerade
2. Replay
3. Modification of messages
4. Denial of service.
▪ Relatively hard to prevent, but easier to detect
1. Release of message contents (Passive Attack)
▪ Replay attack involves the passive capture of a data unit and its
subsequent retransmission to produce an unauthorized effect.
▪ Replay attack is to replay the message sent to a network by an
attacker, which was earlier sent by an authorized user.
3. Modification of messages Attack (Active Attack)
Data
Authentication Access Control Data Integrity Non Repudiation
Confidentiality
Connection
Peer Entity Connection Non Repudiation
Integrity with
Authentication Confidentiality Origin
recovery
Connection
Data Origin Connection less Non Repudiation
Integrity with
Authentication Confidentiality Destination
out recovery
Selective Field
Selective Repeat
Connection
Confidentiality
Integrity
Selective Field
Connection less
Integrity
Authentication
▪ Authentication is the assurance that the communicating entity is
the one that it claims to be.
1. Peer Entity Authentication: Used Who you are ?
in association with a logical (biometrics)
connection (TCP) to provide
confidence in the identity of the
entities connected. Physical
authentication
2. Data-Origin Authentication: In a where you are ?
connectionless (UDP) transfer,
provides assurance that the What you know ?
source of received data is as Password
claimed. One-time Password(OTP)
Security Services
Data
Authentication Access Control Data Integrity Non Repudiation
Confidentiality
Connection
Peer Entity Connection Non Repudiation
Integrity with
Authentication Confidentiality Origin
recovery
Connection
Data Origin Connection less Non Repudiation
Integrity with
Authentication Confidentiality Destination
out recovery
Selective Field
Selective Repeat
Connection
Confidentiality
Integrity
Selective Field
Connection less
Integrity
Access Control
▪ Access control is the prevention of unauthorized use of a resource
▪ This service controls who can have access to a resource, under
what conditions access can occur, and what those accessing the
resource are allowed to do.
User A
User B
Human resources Development
network network
Security Services
Data
Authentication Access Control Data Integrity Non Repudiation
Confidentiality
Connection
Peer Entity Connection Non Repudiation
Integrity with
Authentication Confidentiality Origin
recovery
Connection
Data Origin Connection less Non Repudiation
Integrity with
Authentication Confidentiality Destination
out recovery
Selective Field
Selective Repeat
Connection
Confidentiality
Integrity
Selective Field
Connection less
Integrity
Data Confidentiality
▪ Data confidentiality is the protection of data from unauthorized
disclosure.
1. Connection Confidentiality: The
protection of all user data on a
connection.
2. Connectionless Confidentiality: The
protection of all user data in a single
data block.
3. Selective-Field Confidentiality: The
confidentiality of selected fields
within the user data on a connection
or in a single data block.
4. Traffic-Flow Confidentiality: The
protection of the information that
might be derived from observation of
traffic flows.
Security Services
Data
Authentication Access Control Data Integrity Non Repudiation
Confidentiality
Connection
Peer Entity Connection Non Repudiation
Integrity with
Authentication Confidentiality Origin
recovery
Connection
Data Origin Connection less Non Repudiation
Integrity with
Authentication Confidentiality Destination
out recovery
Selective Field
Selective Repeat
Connection
Confidentiality
Integrity
Selective Field
Connection less
Integrity
Data Integrity
▪ Data integrity is the assurance that data received are exactly as
sent by an authorized entity (i.e., contain no modification,
insertion, deletion, or replay).
Channel
Alice Bob
Data
Authentication Access Control Data Integrity Non Repudiation
Confidentiality
Connection
Peer Entity Connection Non Repudiation
Integrity with
Authentication Confidentiality Origin
recovery
Connection
Data Origin Connection less Non Repudiation
Integrity with
Authentication Confidentiality Destination
out recovery
Selective Field
Selective Repeat
Connection
Confidentiality
Integrity
Selective Field
Connection less
Integrity
Non Repudiation
▪ Nonrepudiation is the assurance that someone cannot deny
something.
▪ Typically, nonrepudiation refers to the ability to ensure that a
communication cannot deny the authenticity of their signature on
a document or the sending of a message that they originated.
Sender Recipient
Security -related Info. Security -related
Message
Message
Message
Message
Transformation Channel Transformation
Secure
Secure
Secret Secret
Information Opponent Information
(Attacker)
Encryption and Decryption
1. Caesar Cipher
2. Monoalphabetic Cipher
3. Playfair Cipher
4. Hill Cipher
5. Polyalphabetic Ciphers
6. One-Time Pad
1. Caesar Cipher
▪ The Caesar Cipher involves replacing each letter of the alphabet
with the letter standing three places further down the alphabet.
▪ For encryption algorithm is:
C = E(3, P) = (P + 3) mod 26
▪ For decryption algorithm is:
P = D(3, C) = (C - 3) mod 26
Caesar Cipher (Cont…)
▪ Let us assign a numerical equivalent to each letter
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y z
13 14 15 16 17 18 19 20 21 22 23 24 25
C = E(3, P) = (P + 3) mod 26
Plain: 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
Cipher: 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
Example:
Plaintext: THE QUICK BROWN FOX
Ciphertext: WKH TXLFN EURZQ IRA
Caesar Cipher (Cont…)
▪ Generalised Caesar Cipher
• Allow shift by k positions.
• Encryption : C = E(K, P) = (P + K) mod 26
Ciphertext:
uzqsovuohxmopvgpozpevsgzwszopfpesxudbmetsxaizvuephzhmdzshz
owsfpappdtsvpquzwymxuzuhsxepyepopdzszufpombzwpfupzhmdjudtm
ohmq
▪ In our ciphertext, the most common digram is ZW, which appears
three times. So equate Z with t, W with h and P with e.
▪ Now notice that the sequence ZWP appears in the ciphertext, and
we can translate that sequence as “the.”
Attack on Monoalphabetic Cipher (Cont…)
▪ If the cryptanalyst knows the nature of the plaintext, then the
analyst can exploit the regularities of the language.
▪ The relative frequency of the letters can be determined and
compared to a standard frequency distribution for English.
▪ If the message were long enough, this technique alone might be
sufficient, but because this is a relatively short message, we
cannot expect an exact match.
Substitution Techniques
1. Caesar Cipher
2. Monoalphabetic Cipher
3. Playfair Cipher
4. Hill Cipher
5. Polyalphabetic Ciphers
6. One-Time Pad
3. Playfair Cipher
▪ The Playfair algorithm is based on a 5 × 5 matrix (key) of letters.
▪ The matrix is constructed by filling in the letters of the keyword
(minus duplicates) from left to right and from top to bottom, and
then filling in the remainder of the matrix with the remaining
letters in alphabetic order. The letters I and J count as one letter.
O C U R E
Example:
N A B D F
Keyword= OCCURRENCE
Plaintext= TALL TREES G H I/J K L
M P Q S T
V W X Y Z
Playfair Cipher - Encrypt Plaintext
▪ Operate on pair of letters (diagram) at a time.
▪ Special: if diagram with same letters appears, separate by special
letter (e.g. x)
Plaintext= TALL TREES
Plaintext= TA LX LT RE ES
▪ If there is an odd number of letters, then add uncommon letter to
complete digram, a X/Z may be added to the last letter.
Plaintext= NETWORK
Plaintext= NE TW OR KX
Playfair Cipher - Encrypt Plaintext
▪ Map each pair in key matrix
O C U R E
Plaintext: TA LX LT RE ES
Ciphertext: PF IZ TZ EO RT N A B D F
G H I/J K L
M P Q S T
V W X Y Z
▪ If the letters are on different rows and columns, replace them with the
letters on other corner of the same row.
▪ The order is important - the first letter of the pair should be replaced
first.
▪ For example, using the table above, the letter pair TA would be
encoded as PF.
Continue
▪ If the letters appear on the same row, replace them with the
letters to their immediate right respectively, wrapping around to
the left side of the row if necessary.
▪ For example, using the table above, the letter pair RE would be
encoded as EO.
▪ If the letters appear on the same column, replace them with the
letters immediately below, wrapping around to the top if
necessary.
▪ For example, using the table above, the letter pair LT would be
encoded as TZ.
Pair: UA AR BE DE XA PO PR QN XA XA NR
Plaintext: we wi lx lm ex et at th ex ex it
Plaintext: we wilxl mexet at thex exit
Plaintext: we will meet at the exit
Substitution Techniques
1. Caesar Cipher
2. Monoalphabetic Cipher
3. Playfair Cipher
4. Hill Cipher
5. Polyalphabetic Ciphers
6. One-Time Pad
4. Hill Cipher
▪ Hill cipher is based on linear algebra
▪ Each letter is represented by numbers from 0 to 25 and
calculations are done using modulo 26.
▪ Encryption and decryption can be given by the following formula:
Encryption: C=PK mod 26
Decryption:
P=CK-1 mod 26
Hill Cipher Encryption
▪ To encrypt a message using the Hill Cipher we must first turn our
keyword and plaintext into a matrix (a 2 x 2 matrix or a 3 x 3
matrix, etc).
Example: Key = “HILL”, Plaintext = “EXAM”
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y z
13 14 15 16 17 18 19 20 21 22 23 24 25
Hill Cipher Encryption (Cont…)
C=PK mod 26
Ciphertext = “ELSC”
Hill Cipher Decryption
P=CK-1 mod 26
Step 1: Find Inverse of key matrix
Step 2: Multiply the Multiplicative Inverse of the Determinant by the
Adjoin Matrix
Step 3: Multiply inverse key matrix with ciphertext matrix to obtain
plaintext matrix
Step 1: Inverse of key matrix
2 X 2 inverse of matrix
3 X 3 inverse of matrix
Step 1: Inverse of key matrix
▪ -11 mod 26 = 15
▪ Because, modulo for negative
number is = N- (B%N)
= 26 – (11%26)
Step 2: Modular (Multiplicative) inverse
▪ The inverse of a number A is 1/A since A * 1/A = 1
e.g. the inverse of 5 is 1/5
▪ In modular arithmetic we do not have a division operation.
▪ The modular inverse of A (mod C) is A-1
▪ (A * A-1) ≡ 1 (mod C)
Example:
▪ The modular inverse of A mod C is the B value that makes
A * A-1 mod C = 1
A = 3, C = 11
Since (3*4) mod 11 = 1, 4 is modulo inverse of 3
A = 10, C = 17 , A-1 = ?12
Step 2: Modular (Multiplicative) inverse
Determinants’ multiplicative inverse Modulo 26
Determinant 1 3 5 7 9 11 15 17 19 21 23 25
Inverse Modulo 26 1 9 21 15 3 19 7 23 11 5 17 25
Step 2: Multiply with adjoin of matrix
X%Y = X-(X/Y)*Y
77%26 = 77-(77/26)*26
= 77-(2)*26
= 77-52
= 25
Hill Cipher Encryption (Cont…)
P=CK-1 mod 26
Plaintext = “EXAM”
Hill Cipher Examples
1. Key: Hill Plaintext: short example
Ciphertext: APADJ TFTWLFJ
2. Key: ACBA Plaintext: DR GREER ROCKS (A=1, B=2, … )
Ciphertext: FZIFTOTBXGPO
3. Key:DACB Ciphertext: SAKNOXAOJ (A=1,B=2,…)
Plaintext: WELOVEMATH
Substitution Techniques
1. Caesar Cipher
2. Monoalphabetic Cipher
3. Playfair Cipher
4. Hill Cipher
5. Polyalphabetic Ciphers
6. One-Time Pad
5. Polyalphabetic Cipher
▪ Monoalphabetic cipher encoded using only one fixed alphabet
▪ Polyalphabetic cipher is a substitution cipher in which the cipher
alphabet for the plain alphabet may be different at different
places during the encryption process.
1. Vigenere cipher
2. Vernam cipher
Plaintext
K
e
y
PT = HELLO
KEY = GMGMG
CT = NQRXU
Vigenere Cipher
Keyword : DECEPTIVE
Key must be as
Key : DECEPTIVEDECEPTIVEDECEPTIVE long as plaintext
else repeat a
Plaintext : WEAREDISCOVEREDSAVEYOURSELF keyword
Ciphertext : ZICVTWQNGRZGVTWAVZHCQYGLMGJ
I R T N G
N E N T E H O O Y
T E C L
Rows/Columns Transposition
▪ Plaintext letters written in rows.
▪ Ciphertext obtained by reading column-by-column, but
re-arranged.
▪ Key determines order of columns to read.
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: TTNA APTMTSUO AODW COIX KNL PETZ
Y
▪ Easy to break using letter frequency (try different column orders)
Rows/Columns Transposition
▪ Transposition ciphers can be made stronger by using multiple
stages of transposition
▪ Plaintext: securityandcryptography
▪ Key: 315624
▪ Ciphertext: EYYARDOYSTRRICGCAPPUNTH
▪ Transpose again using same key:
▪ Ciphertext: YYCURRAHEOIPDRPYSGNATCT
Cryptographic Algorithms
▪ Cryptographic algorithms and protocols can be grouped into four
main areas
Cryptographic
algorithms and
protocols
▪ Data
Authentication
integrity
Symmetric
Asymmetric algorithms
Protocols
encryption
encryption usedused
usedare
to to
to schemes
protect
secure
conceal thebased
blocks
small of
on data,
contents
blocks the
of
of such
usesuch
data,
blocks of
as
or
messages,
cryptographic
streams
as offrom
encryption algorithms
data alteration.
keys
of any designed
and size,
hash to authenticate
including
function messages,
values, whichtheare
files, identity
used of
encryption
in
entities.
keys,
digital
and
signatures.
passwords
Threat and Attack
▪ Threat: A potential for violation of security, which exists when
there is a circumstance, capability, action, or event that could
crack security and cause harm. That is, a threat is a possible
danger that might exploit a vulnerability.
▪ Attack: An violation on system security that derives from an
intelligent threat; that is, an intelligent act that is a calculated
attempt to avoid security services and violate the security policy
of a system.