21CS602-CNS-UNIT-1 Updated
21CS602-CNS-UNIT-1 Updated
21CS602-CNS-UNIT-1 Updated
This document is confidential and intended solely for the educational purpose of
RMK Group of Educational Institutions. If you have received this document
through email in error, please notify the system manager. This document
contains proprietary information and is intended only to the respective group /
learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender
immediately by e-mail if you have received this document by mistake and delete
this document from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in reliance on
the contents of this information is strictly prohibited.
21CS602-CRYPTOGRAPHY
AND NETWORK
SECURITY
Departmentof Computer Science and Engineering
Batch/Year : 2021-2025/III
Course objectives 6
1
Pre Requisites (Course Names with 6
2
Code)
3
Syllabus (With Subject Code, Name, 7
4
LTPC details)
Course outcomes 8
5
CO- PO/PSO Mapping 9
6
Lecture Plan 10
7
Video Links 11
8
10 Lecture Notes 13
Assignments 50
11
Part A Q & A 51
12
Part B Qs 57
13
Supportive online Certification 58
14
courses
Real time Applications in day to day 59
15
life and to Industry
Contents beyond the Syllabus 60
16
COURSE OBJECTIVES
To understand the fundamentals of network security and security
architecture..
PREREQUISITE
21CS502 Computer Networks
21CS602 CRYPTOGRAPHY AND NETWORK
SECURITY
SYLLABUS
21CS602 CRYPTOGRAPHY AND NETWORK SECURITY 3003
UNIT I INTRODUCTION 9
Security trends - Need for Security at Multiple levels, Security Policies - Model of
network security – Security attacks, services and mechanisms – OSI security
architecture – Classical encryption techniques: substitution techniques,
transposition techniques, steganography-
UNIT II SYMMETRIC KEY CRYPTOGRAPHY 9
MATHEMATICS OF SYMMETRIC KEY CRYPTOGRAPHY: Algebraic structures -
Modular arithmetic-Euclid’s algorithm- Congruence and matrices. SYMMETRIC
KEY CIPHERS: SDES – Block cipher Principles of DES – Strength of DES –
Differential and linear cryptanalysis - Block cipher design principles – Block
cipher mode of operation – Evaluation criteria for AES – Advanced Encryption
Standard.
UNIT III PUBLIC KEY CRYPTOGRAPHY 9
MATHEMATICS OF ASYMMETRIC KEY CRYPTOGRAPHY: Primes – Primality Testing
– Factorization – Euler‘s totient function - Chinese Remainder Theorem –
Exponentiation and Alogarithm - ASYMMETRIC KEY CIPHERS: RSA cryptosystem
– Key distribution – Key management – Diffie Hellman key exchange -ElGamal
cryptosystem – Elliptic curve arithmetic Elliptic curve cryptography.
UNIT IV MESSAGE AUTHENTICATION AND INTEGRITY 9
Authentication requirement – Authentication function – MAC – Hash function –
Security of hash function and MAC – SHA –Digital signature and authentication
protocols – DSS- Entity Authentication: Biometrics, Passwords, Challenge
Response protocols- Authentication applications X.509
UNIT V SECURITY PRACTICE AND SYSTEM SECURITY 9
Electronic Mail security – PGP– IP security – Web Security – SYSTEM SECURITY:
Intruders – Malicious software – viruses – Firewalls.
COURSE OUTCOMES
PO’s/PSO’s
COs
PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO PSO
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3
CO1 3 3 3 2 - 2 - - - - - - 1 2 1
2
CO2 3 3 3 2 - - - - - - - 1 2 1
2
CO3 3 3 3 2 - - - - - - - 1 2 1
2
CO4 3 3 3 2 - - - - - - - 1 2 1
2
CO5 3 3 3 2 - - - - - - - 1 2 1
2
CO6 3 3 3 2 - - - - - - - 1 2 1
Actua
l Mode
No Taxo
S No Topics Proposed Lectu Pertaining of
of nomy
date re CO delivery
peri level
ods
Date
Types Of Cryptography
In general there are three types Of cryptography
1. Symmetric Key Cryptography
2. Hash Functions
3. Asymmetric Key Cryptography
Security Trends
Need for security at multiple levels
A Security Domain can have a multi-level policy for one or more security services;
Example: A Domain Security Policy may allow supporting low & moderate
confidentiality services and moderate & high integrity services;
Two entities from a multi-level domain must be assured that an appropriate level
protection is provided for the keys and metadata by the CKMS (Crypto Key
Security Policies
Organizational policies must identify goals, threats, risks;
Information policies must establish data categories, labels, sensitivity levels,
handling restrictions, roles, responsibilities;
Data Security policies must specify human, physical, communications, and
computer protections for data;
CKMS Policies should be configurable and automated to manage keys that protect
sensitive applications and data.
Global secure applications must support various policies.
Goal: Automated security policy specification, negotiation, and enforcement is
desirable for sensitive applications among mutually suspicious but cooperating
organizations. Key Management based on automated dynamic Domain Security
Policy support will help meet this goal.
protection provided.
Approach: Develop an automated Policy Negotiation method using formal syntax
specifications of compatible Security Policies.
Based on, and supports, the sensitive data and applications’ protection
requirements;
Governs key and metadata protection and management throughout the entire
lifecycle of a cryptographic key.
DOC/NIST’s Information and Data Security Policies include all aspects of protecting
information and data. These include:
The potential impact on DOC, NIST, Federal employees, and private individuals is
categorized as:
low (limited),
moderate (serious), or
Low Impact
The loss could be expected to have a limited adverse effect on organizational
operations, organizational assets, or individuals.
A limited adverse effect means that, for example, the loss of confidentiality,
integrity, or availability might
(i)cause a degradation in mission capability to an extent and duration that the
organization is able to perform its primary functions, but the effectiveness of the
functions is noticeably reduced;
High Impact
The loss could be expected to have a severe or catastrophic adverse effect on
organizational operations, organizational assets, or individuals.
A severe or catastrophic adverse effect means that, for example, the loss might
(i)cause a severe degradation in or loss of mission capability to an extent and
duration that the organization is not able to perform one or more of its primary
functions;
SECURITY ATTACK
A useful means of classifying security attacks, used both in X.800 and RFC 2828, is
in terms of passive attacks and active attacks. A passive attack attempts to learn
or make use of information from the system but does not affect system resources.
An active attack attempts to alter system resources or affect their operation.
Active attacks
Masquerade (Fabrication)
Replay
Modification
Denial of service
Passive attacks:
Passive attacks are in the nature of eavesdropping on, or monitoring of,
transmissions. Passive attacks are very difficult to detect because they do not
involve any alteration of data. However, it is feasible to prevent the success of these
attacks. The goal of the opponent is to obtain information that is being transmitted.
Active attacks:
These attacks involve some modification of the data stream or the creation of a
false stream. It is quite difficult to prevent active attacks absolutely, because to do
so would require physical protection of all communication facilities and paths at all
times. Instead, the goal is to detect them and to recover from any disruption or
delays caused by them.
Figure 5: Masquerade
2)Replay – involves passive capture of a data unit and its subsequent transmission
to produce an unauthorized effect.
Figure 6: Replay
3)Modification – Some portion of message is altered or the messages are delayed
or recorded, to produce an unauthorized effect.
Figure 7: Modification
SECURITY SERVICES
X.800 defines a security service as a service provided by a protocol layer of
communicating open systems, which ensures adequate security of the systems or
of data transfers. As per RFC 2828, the definition is “ a processing or
communication service that is provided by a system to give a specific
kind of protection to system resources; security services implement
security policies and are implemented by security mechanisms”.
X.800 divides the security services into five categories and fourteen specific
services
1) AUTHENTICATION:
The assurance that the communicating entity is the one that it claims to be.
Peer Entity Authentication: Used in association with a logical connection to
provide confidence in the identity of the entities connected.
Data Origin Authentication: In a connectionless transfer, provides assurance
that the source of received data is as claimed.
2 ) ACCESS CONTROL:
The prevention of unauthorized use of a resource (i.e., 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.
4) DATA INTEGRITY:
The assurance that data received are exactly as sent by an authorized entity (i.e.,
contain no modification, insertion, deletion, or replay).
Connection Integrity with Recovery: Provides for the integrity of all user data
on a connection and detects any modification, insertion, deletion, or replay of any
data within an entire data sequence, with recovery attempted.
Connection Integrity without Recovery: As above, but provides only
detection without recovery.
Selective-Field Connection Integrity: Provides for the integrity of selected
fields within the user data of a data block transferred over a connection and takes
the form of determination of whether the selected fields have been modified,
inserted, deleted, or replayed.
Connectionless Integrity:
Provides for the integrity of a single connectionless data block and may take the form of
detection of data modification. Additionally, a limited form of replay detection may be
provided.
5) NONREPUDIATION:
Provides protection against denial by one of the entities involved in a communication of
having participated in all or part of the communication.
Nonrepudiation, Origin: Proof that the message was sent by the specified party.
Nonrepudiation, Destination: Proof that the message was received by the specified
party.
SECURITY MECHANISMS
The security mechanisms defined by X.800 are divided into those that are implemented
in a specific protocol layer, such as TCP or an application-layer protocol, and those that are
not specific to any particular protocol layer or security service. X.800 distinguishes between
reversible encipherment mechanisms and irreversible encipherment mechanisms.
A reversible encipherment mechanism is simply an encryption algorithm that allows data
to be encrypted and subsequently decrypted. Irreversible encipherment mechanisms
include hash algorithms and message authentication codes, which are used in digital
signature and message authentication applications.
Specific security mechanisms are encipherment, digital signatures, access
controls, data integrity, authentication exchange, traffic padding, routing control
and notarization.
Encipherment
The use of mathematical algorithms to transformdata into a form that is not
readily intelligible. Thetransformation and subsequent recovery of thedata depend
Digital Signature
Data appended to, or a cryptographic transformationof, a data unit that allows a
recipient of the data unitto prove the source and integrity of the data unit and
Access Control
Data Integrity
A variety of mechanisms used to assure the integrityof a data unit or stream of
data units.
Authentication Exchange
A mechanism intended to ensure the identity of anentity by means of
information exchange.
Traffic Padding
The insertion of bits into gaps in a data stream tofrustrate traffic analysis
attempts.
Routing Control
Enables selection of particular physically secureroutes for certain data and allows
routing changes,especially when a breach of security is suspected.
Notarization
The use of a trusted third party to assure certainproperties of a data exchange.
Trusted Functionality
That which is perceived to be correct with respectto some criteria (e.g., as
established by a securitypolicy).
Security Label
The marking bound to a resource (which may be adata unit) that names or
designates the security attributes of that resource.
Event Detection
Detection of security-relevant events.
Security Recovery
Deals with requests from mechanisms, such as eventhandling and management
functions, and takes recovery actions.
A source produces a message in plaintext, X = [X1, X2, … , XM] where M are the
number of letters in the message. A key of the form K = [K1, K2, …, KJ] is
generated. If the key is generated at the source, then it must be provided to the
destination by means of some secure channel.
With the message X and the encryption key K as input, the encryption algorithm
forms the cipher text Y = [Y1, Y2, …, YN]. This can be expressed as
Y = EK(X)
The intended receiver, in possession of the key, is able to invert the
transformation:
X = DK(Y)
An opponent, observing Y but not having access to K or X, may attempt to recover
X or K or both. It is assumed that the opponent knows the encryption and decryption
algorithms. If the opponent is interested in only this particular message, then the
focus of effort is to recover X by generating a plaintext estimate. Often if the
opponent is interested in being able to read future messages as well, in which case
an attempt is made to recover K by generatingan estimate. The essential elements
of a symmetric encryption scheme is shownin the figure below:
Cipher text only – A copy of cipher text alone is known to the cryptanalyst.
Known plaintext – The cryptanalyst has a copy of the cipher text and the corresponding
plaintext.
Chosen plaintext – The cryptanalysts gains temporary access to the encryption machine.
They cannot open it to find the key, however; they can encrypt a large number of suitably
chosen plaintexts and try to use the resulting cipher texts to deduce the key.
Chosen cipher text – The cryptanalyst obtains temporary access to the decryption
machine, uses it to decrypt several string of symbols, and tries to use the results to deduce
the key.
Chosen text: Plaintext message chosen by cryptanalyst, with its corresponding ciphertext
generated, purported ciphertext chosen by cryptanalyst, with its corresponding decrypted
plaintext.
SUBSTITUTION TECHNIQUES
1. Caesar cipher (or) shift cipher
2. Playfair cipher
3. Hill cipher
4. Polyalphabetic ciphers
1. Vigenere cipher
2. Vernam cipher
3. One Time Pad cipher
TRANSPOSITION TECHNIQUES
1. Rail fence
2. Row Transposition Ciphers
A substitution technique is one in which the letters of plaintext are replaced by
other letters or by numbers or symbols. If the plaintext is viewed as a sequence
of bits, then substitution involves replacing plaintext bit patterns with cipher text
bit patterns.
Example 1:
Plain text: pay more money
Cipher text: SDB PRUH PRQHB
Example 2:
Disadvantages
The encryption and decryption algorithm are known.
There are only 25 keys to try.
Example:
Plaintext = meet me at the school house
Splitting two letters as a unit =>me et me at th es ch ox ol ho us ex
Corresponding cipher text => CL KL CL RS PD IL HY AV MP HF XL IU
Example 2:
Plain text : Balloon
Repeating plain text letter that fall in the same pair are repeated with the filler
letter ‘X’.
Plain text : ba lx lo on
Cipher text : IB SU PM NA
Advantage
It is difficult to identify particular diagrams.
Frequency analysis is more difficult.
Disadvantages
It is relatively easy to be broken.
The sufficient number of cipher text letter is very small.
Hill Cipher
Hill cipher is a poly-graphic substitution cipher based on linear algebra.
Hill used matrices and matrix multiplication to mix up the plain text.
Each letter is represented by a number modulo 26.
To encrypt a message, each block of ‘n’ letters is multiplied by an invertible n x n matrix,
again modulus 26.
To decrypt the message, each block is multiplied by the inverse of the matrix used
for encryption.
Example:
POLYALPHABETIC CIPHERS
Another way to improve on the simple monoalphabetic technique is to use different
monoalphabetic substitutions as one proceeds through the plaintext message. The
general name for this approach is polyalphabetic cipher. All the techniques have the
following features in common.
Example:
Plain text : Good Morning
Key : text
Solution : G o o d M o r n i n g
Te xtt extt ex
Cipher text : z s l w f s o g b r d
To encrypt, pick the letter in the plain text and its corresponding letter in the
keyword. The plain text is considered as row index and the keyword letter as
column index.
Here in the above example letter ‘G’ from row and letter ‘T’ from colum intersects
and produces the letter ‘Z’.
For decryption, pick the letter from the keyword as column index and search for
the cipher text. The intersection of corresponding row gives the plain text.
In our example letter ‘t ’ is considered as column index searching for cipher text
z’. The corresponding row index produces the plain text ‘g’.
Cipher text : zslw fsogbrd
Key : text texttex
Plain text : Good morning
Advantage
Multiple cipher text letters are used for each plain text letters.
VERNAM CIPHER
The ultimate defense against such a cryptanalysis is to choose akeyword that is
as long as the plaintext and has no statistical relationship to it. This cipher works
on binary data (bits) rather than letters. The system can beexpressed succinctly
as follows :
ci= pi ki
where
pi= ith binary digit of plaintext
ki= ith binary digit of key
ci= ith binary digit of ciphertext
= exclusive-or (XOR) operation
Thus, ciphertext is generated by performing the bitwise XOR of the plaintextand
the key. Because of the use of the properties of the XOR, decryption simply
involves the same bitwise operation:
pi= ci ki
Example:
Plaintext =00101001
Key = 10 101100
Ciphertext =10000101
Suppose that we are using a Vigenère scheme with 27 characters in which the
twenty-seventh character is thespace character, but with a one-time key that is as
long as the message.
Consider the ciphertext
ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS
Advantage
It is a highly source method because it generates random keys
Disadvantages
Sending the key securely is a problem.
Randomness is also a disadvantage.
TRANSPOSITION TECHNIQUES
All the techniques examined so far involve the substitution of a cipher text symbol
for a plaintext symbol. A very different kind of mapping is achieved by performing
some sort of permutation on the plaintext letters. This technique is referred to as
a transposition cipher.
RAIL FENCE:
It is simplest of such cipher, in which the plaintext is written down as a sequence
of diagonals and then read off as a sequence of rows.
m e a t e c o l o s
e t t h s h o h u e
The encrypted message is
MEATECOLOSETTHSHOHUE
ROW TRANSPOSITION CIPHER:
A more complex scheme is to write the message in a rectangle, row by row, and
read the message off, column by column, but permute the order of the columns.
The order of columns then becomes the key of the algorithm.
Example:
Plaintext = meet at the school house
Key = 4 3 1 2 5 6 7
Plaintext = m e e t a t t
h e s c h o o
l h o u s e z
Cipertext = ESOTCUEEHMHLAHSTOETOZ
STEGANOGRAPHY
A plaintext message may be hidden in any one of the two ways. The methods of
steganography conceal the existence of the message, whereas the methods of
cryptography render the message unintelligible to outsiders by various
transformations of the text. A simple form of steganography, but one that is time
consuming to construct is one in which an arrangement of words or letters within
an apparently innocuous text spells out the real message. e.g., (i) the sequence
of first letters of each word of the overall message spells out the real (hidden)
message. (ii) Subset of the words of the overall message is used to convey the
hidden message. Various other techniques have been used historically, some of
them are
Drawbacks of Steganography
Requires a lot of overhead to hide a relatively few bits of information.
Once the system is discovered, it becomes virtually worthless.
MODERN CRYPTOGRAPHY
Modern cryptography is the cornerstone of computer and communications
security. Its foundation is based on various concepts of mathematics such as
number theory, computational-complexity theory, and probability theory.
1. Do you think that necessity of keeping files secure arises more during COVID
lockdown? (k4,CO1)
it. Cryptography not only protects data from theft or alteration, but can also be used
by an organization.
Security mechanism: A process (or a device incorporating such a process) that
organization. The services are intended to counter security attacks, and theymake
circumstance, capability, action, or event that could breach security and cause
harm. That is, a threat is a possible danger that might exploit vulnerability.
Attack -An assault on system security that derives from an intelligent threat; that
is, an intelligent act that is a deliberate attempt (especially in the sense of a method
or technique) to evade security services and violate the security policy ofa system.
Define Steganography.(CO2,K1)
A plaintext message may be hidden . The methods of steganography conceal the
existence of the message
Example Techniques: character marking, invisible ink, pin punctures, type writer
correction ribbon.
➢ The cost of breaking the cipher exceeds the value of the encrypted information.
➢ The time required to break the cipher exceeds the useful lifetime of the
information.
What are the techniques that have been used historically for
steganography?(CO2,K1)
➢ Character marking
➢ Invisible ink
➢ Pin punctures
➢ Typewriter correction ribbon
NPTEL
Cyber Security and Privacy
Ethical Hacking
Computational number theory and cryptography
COURSERA
Cryptography
Applied Cryptography
Number theory and cryptography
Cryptography and Information theory
Asymmetric cryptography and key management
Symmetric Cryptography
UDEMY
Introduction to Cryptography
Cryptography with python
Applied Cryptography with Python
Authentication/Digital Signatures
Time Stamping
Electronic Money
Secure Network Communications
Disk Encryption
Encryption/Decryption in email:
Encryption in WhatsApp, Instagram
Sim card Authentication:
Secrecy in transmission
Secrecy in storage
Integrity in transmission
Authentication of identity
Contents beyond the Syllabus
REFERENCES:
1.C K Shyamala, N Harini and Dr. T R Padmanabhan: Cryptography and Network
Security, Wiley India Pvt.Ltd
2.Behrouz A.Foruzan, Cryptography and Network Security, Tata McGraw Hill 2007.
3.Charlie Kaufman, Radia Perlman, and Mike Speciner, Network Security:
PRIVATE Communication in a PUBLIC World, Prentice Hall, ISBN 0-13-046019-2
Mini Projects Suggestions
1. Assessment of Different cyber Attacks
2. Network Monitoring
3. Command line interface for crypto functionality
4.Action history view with replay functionality (like a macro recorder) for all algorithm
operations (classic and modern)
14.Implement the Hill Cipher algorithm and Allow users to input the matrix key.
ASSESSMENT SCHEDULE
Disclaimer:
This document is confidential and intended solely for the educational purpose of RMK Group of
Educational Institutions. If you have received this document through email in error, please notify the
system manager. This document contains proprietary information and is intended only to the
respective group / learning community as intended. If you are not the addressee you should not
disseminate, distribute or copy through e-mail. Please notify the sender immediately by e-mail if you
have received this document by mistake and delete this document from your system. If you are not the
intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance
on the contents of this information is strictly prohibited.