21CS602-CNS-UNIT-1 Updated

Download as pdf or txt
Download as pdf or txt
You are on page 1of 64

Please read this disclaimer before proceeding:

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

Created by: Mr.K.Mohanasundaram


Ms.J.Sherine Glory
Date : 03.01.2024
Table of Contents
S.NO CONTENTS PAGE NUMBER

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

9 Activity Based Learning 12

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

Text Book and Reference Books 61


17
Mini project Suggestions 62
18
Assessment Schedule 63
19
21CS602 CRYPTOGRAPHY AND NETWORK
SECURITY

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

To Understand the fundamentals of networks


CO1 security, security architecture, threats and
vulnerabilities

To learn the different symmetric key cryptographic


CO2
algorithms
To study the various asymmetric key cryptographic
CO3
algorithms and techniques.
To know the importance of message authentication
CO4
and integrity.
To learn the various security practices and system
CO5
security mechanisms
CO-PO MAPPING

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

1 – Low, 2 – Medium, 3 – Strong


LECTURE PLAN

Actua
l Mode
No Taxo
S No Topics Proposed Lectu Pertaining of
of nomy
date re CO delivery
peri level
ods
Date

Course objective, 1 03.1.2024


ICT
course outcome CO1
1 K1 Tools
delivery & Course
introduction
Security trends - 1
Need for Security 04.1.2024 K2
at Multiple levels CO1 ICT
2
Tools

Security Policies, 1 06.1.2024


ICT
3 Model of network CO1 K2 Tools
security
Security attacks, 1 08.1.2024 ICT
services and CO1 K2 Tools
mechanisms
4
OSI security 1 09.1.2024 ICT
architecture CO1 K2 Tools
5
Classical 1 10.1.2024 CO1 Black
6 encryption K3 Board
techniques:
substitution 1 11.1.2024 CO1 K3 Black
7 techniques Board

1 23.1.2024 CO1 Black


transposition
8 techniques, K3 Board

1 24.1.2024 CO1 K3 ICT


9 steganography Tools
VIDEO LINKS
Link
S.NO TOPICS
Steganography Hidden secret https://www.youtube.co
1 m/watch?v=WTA7KR9-
message
9lM
https://www.youtube.co
2 Cryptographic attacks m/watch?v=BXq2T3BDL
Bo
History and Evolution of https://www.youtube.co
3 Cryptography and m/watch?v=z9Qi5mDSY
Cryptanalysis b8&t=67s
https://www.youtube.co
4 Network Security m/watch?v=Jt9lxEoWuY
s
https://www.youtube.co
5 Cybercrime m/watch?v=87N2GPEIy
AE
https://www.youtube.co
6 Perfect Secrecy m/watch?v=vKRMWew
GE9A
7 Security Services https://www.youtube.c
om/watch?v=bRgL_Dry
7uw
8 Security Mechanisms https://youtu.be/H5ifNV
eDXkg?si=EGMc4FPQw
PI1kxpX
9 Polyalphabetic Cipher https://www.youtube.c
om/watch?v=BgFJD7oC
mDE
10 Hill Cipher Encryption https://youtu.be/-
EQ8UomTrAQ?si=1lNwl
UvoLZAOBTtq
11 Hill Cipher Decryption https://youtu.be/JK3ur6
W4rvw?si=df9gzjjBeQio
aagk
ACTIVITY BASED LEARNING-PUZZLE
Unit-1
Cryptography is technique of securing information and communications through
use of codes so that only those person for whom the information is intended can
understand it and process it.

Thus preventing unauthorized access to information. The prefix “crypt” means


“hidden” and suffix graphy means “writing”

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

Management System) in accordance with the multi-level policy.

Multi-Level Security: Selectable based on requirements and costs (e.g.,


processing time) ;
Scalable Security: Selects acceptable level of protection while minimizing costs;
Selectable Security: CKMS Multi-Domain Policy Enforcement supports selectable
security;
Negotiated Security for Transaction: Based on the policies of two or more
entities participating in a sensitive transaction; Requires creation of a new

temporary or permanent Security Policy for the transaction.

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.

Security Policy Specifications


A Security Policy should be written so that people can understand and follow it;
A Security Policy should be encoded so that an automated system can enforce it;
A formal specification of a security policy can be understandable to humans and
automatically enforced by a CKMS.

Security-Domain Based Cryptographic Key Management


Goal: Automated negotiation of key management based on the domain security
policies of two or more mutually suspicious participants in a sensitive transaction.
Assumption: Security is proportional to cost, the services used, and the

protection provided.
Approach: Develop an automated Policy Negotiation method using formal syntax
specifications of compatible Security Policies.

Information Management Policy


Highest-Level Organizational Policy for Managing and Protecting Information in all
forms (paper, computer data, electronic storage);

Established by the Organization’s CEO or CIO;


Policy is provided to all the Organization’s employees so they can follow the policy
Based primarily on organization’s goals and objectives;
Based often on industry standards of good practice (e.g., health patient privacy
rules);
Assigns Information Management Roles and Responsibilities to individuals;
Foundation for Information Security Policy

Information Security Policy


Establishes high-level rules for protecting organization’s information independent
of the storage media (e.g., paper, electronic)
Establishes information sensitivity levels
Establishes security labels for information
Protection services are based on threats
Level of protection is based on risks to information that could result in its loss, or
its unauthorized disclosure or modification

Data Security Policy


Based on the Information Security Policy
Rules for protecting electronic information
Governs use of Computers & Applications
Covers use of communication networks
Specifies data security levels, labels, etc.
Basis of Cryptographic Data Protection
Basis of Cryptographic Key Management

CKMS Security Policy


Based on an organization’s Data Security Policy, specifically on data cryptographic
protection;
Protecting a cryptographic key and its associated metadata is required to protect
the information protected by the key;
Often based on CKMS Profiles (e.g., Federal) of organizations using the services of
the CKMS;
CKMS Technical Capabilities must support and be used to enforce the CKMS
Security Policy.
Specifies detailed CKMS requirements for protecting cryptographic keys and their
associated metadata within the CKMS;

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.

Relationships among Policies


Policy statements should be layered from high to low ranging from high level
goals to details on how to implement and enforce the policy; e.g. Simple high-

level policy: Protect sensitive data;


Simple mid-level policy: Encrypt sensitive data during communication and in
long-term storage;
Simple low-level policy: Encrypt and Label data with AES-128 whenever it is
stored outside a physically secure facility;
Simple CKMS policy: Use a validated FIPS140-2 Cryptographic Module
whenever encrypting the application data and the Key used to encrypt it.

DOC/NIST’s Information and Data Security Policies include all aspects of protecting
information and data. These include:

Confidentiality – Protecting Data from unauthorized disclosure;


Integrity –Protecting Electronic Data from unauthorized, unanticipated, or
unintentional modification;

Availability – Electronic Data must be available on a timely basis.

The potential impact on DOC, NIST, Federal employees, and private individuals is
categorized as:

low (limited),
moderate (serious), or

high (catastrophic or severe)

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;

(ii) result in minor damage to organizational assets;


(iii) result in minor financial loss; or
(iv) result in minor harm to individuals.
Moderate Impact
The loss could be expected to have a serious adverse effect on organizational
operations, assets, or individuals.

A serious adverse effect means that, e.g., the loss might


(i)cause a significant 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 significantly reduced;

(ii) result in significant damage to organizational assets;


(iii) result in significant financial loss; or
(iv)result in significant harm to individuals that does not involve loss of life or
serious, life-threatening injuries.

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;

(ii) result in major damage to organizational assets;


(iii) result in major financial loss; or
(iv)result in severe or catastrophic harm to individuals involving loss of life or
serious life threatening injuries
A MODEL FOR NETWORK SECURITY
A message that needs to be transferred from one party to another across some
sort of internet must cooperate for the exchange of the message. The two parties i.e.,
the sender and receiver are also called as principals. For the transfer of messages,
➢ A logical information channel needs to be established between the sender and
the receiver.
➢ communication protocols (e.g., TCP/IP) must be used by the sender and
receiver.
A model for network security is shown in Figure 1.

Figure 1: Model for network security.


All the techniques for providing security have two components:
1. A security-related transformation on the information to be sent.
Examples:
➢ the encryption of the message, which scrambles the message so that it is
unreadable by the opponent,
➢ addition of a code based on the contents of the message, which can be used to
verify the identity of the sender
2. Some secret information shared by the two principals (sender and receiver)
Examples:
➢ An Encryption key used along with the transformation to scramble the message
before its transmission and unscramble it on reception.
A trusted third party may be needed to achieve secure transmission. For
example, a third party may be responsible for distributing the secret information
to the two principals while keeping it from any opponent.

Basic tasks in designing a particular security service:


1. Design an algorithm for performing the security-related transformation. The
algorithm should be such that an opponent cannot defeat its purpose.
2. Generate the secret information to be used with the algorithm.
3. Develop methods for the distribution and sharing of the secret information.
4. Specify a protocol to be used by the two principals that makes use of the
security algorithm and the secret information to achieve a particular security
service.
The security mechanisms needed to cope with unwanted access is shown in
Figure 2. The hacker is someone who simply gets satisfaction from breaking
and entering a computer system. Viruses and worms are two examples of
software attacks. Such attacks are introduced into a system by means of a disk
that contains the unwanted logic provided along with useful software
The gatekeeper function includes password-based login procedures that are
designed to allow only authorized users and deny all others. The second level of
security consists of a variety of internal security controls that detects the presence
of unwanted intruders.

Figure 2: Network Access Security Model

Another type of unwanted access is the placement of logic in a computer system


that that can affect application programs as well as utility programs, such as editors
and compilers. Programs can present two kinds of threats:
➢ Information access threats intercept or modify data on behalf of users who
should not have access to that data.
➢Service threats exploit service flaws in computers to inhibit use by legitimate
users.
THE OSI SECURITY ARCHITECTURE
To assess the security needs of an organization effectively, the manager responsible
for security needs some systematic way of defining the requirements for security
and characterization of approaches to satisfy those requirements. Oneapproach is
to consider three aspects of information security:
Security attack – Any action that compromises the security of information
owned by an organization.

Security mechanism – A mechanism that is designed to detect, prevent or


recover from a security attack.
Security service – A service that enhances the security of the data processing
systems and the information transfers of an organization. The services are
intended to counter security attacks and they make use of one or more security
mechanisms to provide the service.

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.

Security attacks could be broadly categorized as


Passive attacks
Release of message contents
Traffic analysis

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.

Passive attacks are of two types:


1) Release of message contents: A telephone conversation, an e-mail message
and a transferred file may contain sensitive or confidential information. We would
like to prevent the opponent from learning the contents of these transmissions.

Figure 3: Release of message contents

2) Traffic analysis: Even though encryption protection exists in place, an opponent


might still be able to observe the pattern of the message. The opponent could
determine the location and identity of communication hosts and could observethe
frequency and length of messages being exchanged. This information might be
useful in guessing the nature of communication that was taking place
Figure 4: Traffic Analysis

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.

These attacks can be classified in to four categories:


1) Masquerade (Fabrication) – One entity pretends to be a different entity.

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

4)Denial of service – Prevents or inhibits the normal use or management of


communication facilities. Another form of service denial is the disruption of an
entire network, either by disabling the network or overloading it with messages so
as to degrade performance.
Figure 8: Denial of service

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”.

The classification of security services are as follows:


1. Confidentiality: Ensures that the information in a computer system and
transmitted information are accessible only for reading by authorized parties.
Example: printing, displaying and other forms of disclosure.
2.Authentication: Ensures that the origin of a message or electronic document
is correctly identified, with an assurance that the identity is not false. the function
of the authentication service is to assure the recipient that the message is from the
source that it claims to be from.
Two specific authentication services are defined in X.800:
Peer entity authentication: Provides for the corroboration of the identity of a
peer entity in an association. It is provided for use at the establishment of, or at
times during the data transfer phase of, a connection. It attempts to provide
confidence that an entity is not performing either a masquerade or an unauthorized
replay of a previous connection.
Data origin authentication: Provides for the corroboration of the source of a
data unit. It does not provide protection against the duplication or modification of
data units. This type of service supports applications like electronic mail where there
are no prior interactions between the communicating entities.
3) Integrity: Ensures that only authorized parties are able to modify computer system
assets and transmitted information. Modification includes writing, changing status,
deleting, creating and delaying or replaying of transmitted messages.
4) Non repudiation: Requires that neither the sender nor the receiver of amessage
be able to deny the transmission.
5) Access control: Requires that access to information resources may be
controlled by or the target system.
6) Availability: Requires that computer system assets be available to authorized
parties when needed.

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.

3) DATA CONFIDENTIALITY: The protection of data from unauthorized disclosure.


Connection Confidentiality: The protection of all user data on a connection.
Connectionless Confidentiality: The protection of all user data in a single data
block.
Selective-Field Confidentiality: The confidentiality of selected fields within
the user data on a connection or in a single data block.
Traffic Flow Confidentiality: The protection of the information that might be
derived from observation of traffic flows.

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.

Selective-Field Connectionless Integrity:


Provides for the integrity of selected fields within a single connectionless data block; takes
the form of determination of whether the selected fields have been modified.

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.

Pervasive security mechanisms are trusted functionality, security labels,

event detection, security audit trails, security recovery.

SPECIFIC SECURITY MECHANISMS

Encipherment
The use of mathematical algorithms to transformdata into a form that is not
readily intelligible. Thetransformation and subsequent recovery of thedata depend

on an algorithm and zero or moreencryption keys.

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

protect against forgery (e.g., by the recipient).

Access Control

A variety of mechanisms that enforce access rights toresources.

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.

PERVASIVE SECURITY MECHANISMS

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 Audit Trail


Data collected and potentially used to facilitate asecurity audit, which is an
independent review and examination of system records and activities.

Security Recovery
Deals with requests from mechanisms, such as eventhandling and management
functions, and takes recovery actions.

CLASSICAL ENCRYPTION TECHNIQUES


Cryptographic systems are characterized along three independent dimensions:
1. The type of operations used for transforming plaintext to ciphertext.
All encryption algorithms are based on two general principles:
➢ Substitution, in which each element in the plaintext (bit, letter, group of bits or
letters) is mapped into another element, and

➢Transposition, in which elements in the plaintext are rearranged. The


fundamental requirement is that no information be lost (that is, that all operations
are reversible). Most systems, referred to as product systems, involvemultiple
stages of substitutions and transpositions.

2. The number of keys used.


➢ Symmetric encryption : If both sender and receiver use the same key, the
system is referred to as symmetric, single-key, secret-key, or conventional
encryption.
➢ Asymmetric encryption: If the sender and receiver use different keys, the
system is referred to as asymmetric, two-key, or public-key encryption.
3. The way in which the plaintext is processed.
➢ Block cipher processes the input one block of elements at a time, producing an
output block for each input block.
➢ Stream cipher processes the input elements continuously, producing output one
element at a time, as it goes along.

Some basic concepts are defined below:


Cryptography : The art or science encompassing the principles and methods of
transforming an intelligible message into one that is unintelligible, and then
retransforming that message back to its original form .

Plaintext : The original intelligible message


Cipher text: The transformed message
Cipher : An algorithm for transforming an intelligible message into one that is
unintelligible by transposition and/or substitution methods
Key: Some critical information used by the cipher, known only to the sender&
receiver
Encipher (encode) : The process of converting plaintext to cipher text using a
cipher and a key
Decipher (decode) : the process of converting cipher text back into plaintext
using a cipher and a key
Cryptanalysis : The study of principles and methods of transforming an
unintelligible message back into an intelligible message without knowledge of the
key. Also called code breaking

Cryptology : Both cryptography and cryptanalysis


SYMMETRIC CIPHER MODEL
A symmetric encryption scheme has five ingredients :
Plaintext: This is the original intelligible message or data that is fed into the
algorithm as input.
Encryption algorithm: The encryption algorithm performs various substitutions
and transformations on the plaintext.
Secret key: The secret key is also input to the encryption algorithm.The key is a
value independent of the plaintext and of the algorithm. The algorithm will produce
a different output depending on the specific key being used at the time. The exact
substitutions and transformations performed by the algorithm depend on the key.
Ciphertext: This is the scrambled message produced as output. It depends on the
plaintext and the secret key. For a given message, two different keys will produce
two different ciphertexts. The ciphertext is an apparently random stream of data
and, as it stands, is unintelligible.

Decryption algorithm: This is essentially the encryption algorithm run in reverse.


It takes the ciphertext and the secret key and produces the original plaintext.

Here the original message, referred to as plaintext, is converted into apparently


random nonsense, referred to as cipher text. The encryption process consists of
an algorithm and a key. The key is a value independent of the plaintext. Changing
the key changes the output of the algorithm. Once the cipher text is produced, it
may be transmitted. Upon reception, the cipher text can be transformed back to
the original plaintext by using a decryption algorithm and the same key that was
used for encryption.
The security depends on several factors. First, the encryption algorithm must be
powerful enough that it is impractical to decrypt a message on the basis of cipher
text alone. Beyond that, the security depends on the secrecy of the key, not the
secrecy of the algorithm.
Two requirements for secure use of symmetric encryption:
a strong encryption algorithm
a secret key known only to sender / receiver
Y = EK(X)
X = DK(Y)
assume encryption algorithm is known
implies a secure channel to distribute key

Figure : Simplified Model of Symmetric Encryption

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:

Figure: Model of Symmetric Cryptosystem


Cryptanalysis
The process of attempting to discover X or K or both is known as cryptanalysis. The strategy
used by the cryptanalysis depends on the nature of the encryption scheme and the
information available to the cryptanalyst.
There are various types of cryptanalytic attacks based on the amount of information known
to the cryptanalyst.

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.

CAESAR CIPHER (OR) SHIFT CIPHER


The earliest known use of a substitution cipher and the simplest was by Julius
Caesar. The Caesar cipher involves replacing each letter of the alphabet with the
letter standing 3 places further down the alphabet.

Example 1:
Plain text: pay more money
Cipher text: SDB PRUH PRQHB
Example 2:

Plain text : Return to home


Cipher text : UHWXUQ WR KRPH
Note that the alphabet is wrapped around, so that letter following ‘z’ is ‘a’.
For each plaintext letter p, substitute the cipher text letter c such that
C = E(P) = (P+3) mod 26
A shift may be any amount, so that general Caesar algorithm is
C = E(P) = (P+k) mod 26
Where k takes on a value in the range 1 to 25. The decryption algorithm is simply
P = D(C) = (C-k) mod 26

Disadvantages
The encryption and decryption algorithm are known.
There are only 25 keys to try.

The language of the plain text is known


PLAYFAIR CIPHER
The best known multiple letter encryption cipher is the playfair, which treats
digrams in the plaintext as single units and translates these units into cipher text
digrams. The playfair algorithm is based on the use of 5x5 matrix of letters
constructed using a keyword. Let the keyword be ‘monarchy’. 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 alphabetical order. The letter ‘i’ and ‘j’ count as one letter.
Plaintext is encrypted two letters at a time according to the following rules:
Repeating plaintext letters that would fall in the same pair are separated with a
filler letter such as ‘x’.
Plaintext letters that fall in the same row of the matrix are each replaced by the
letter to the right, with the first element of the row following the last.
Plaintext letters that fall in the same column are replaced by the letter beneath,
with the top element of the column following the last.
Otherwise, each plaintext letter is replaced by the letter that lies in its own row
and the column occupied by the other plaintext letter.

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

Strength of playfair cipher


Playfair cipher is a great advance over simple mono alphabetic ciphers.
Since there are 26 letters, 26x26 = 676 diagrams are possible, so identification of
individual digram is more difficult.

Frequency analysis is much more difficult.

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.

A set of related monoalphabetic substitution rules are used


A key determines which particular rule is chosen for a given transformation.
To encrypt a message, a key is needed that is as long as the message, ignoring
spaces and punctuation.

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

ONE TIME PAD CIPHER:


An Army Signal Corp officer, Joseph Mauborgne, proposed an improvement to the
Vernam cipher that yields the ultimate in security. Mauborgne suggested using a
random key that is as long as the message, so that the key need not be repeated.
In addition, the key is to be used to encrypt and decrypt a single message, and
then is discarded. Each new message requires a new key of the same length as
the new message. Such a scheme, known as a one-time pad, is unbreakable.

It produces random output that bears no statistical relationship to the plaintext.


Because the ciphertext contains no information whatsoever about the plaintext,
there is simply no way to break the code.

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

Two different decryptions using two different keys:


Ciphertext: ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS
Key: pxlmvmsydofuyrvzwctnlebnecvgdupahfzzlmnyih
Plaintext: mr mustard with the candlestick in the hall
Ciphertext: ANKYODKYUREPFJBYOJDSPLREYIUNOFDOIUERFPLUYTS
Key: pftgpmiydgaxgoufhklllmhsqdqogtewbqfgyovuhwt
Plaintext: miss scarlet with the knife in the library.

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.

Plaintext = meet at the school house


To encipher this message with a rail fence of depth 2, the message is written as
follows:

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

Character marking – selected letters of printed or typewritten text are


overwritten in pencil. The marks are ordinarily not visible unless the paper is held
to an angle to bright light.
Invisible ink – a number of substances can be used for writing but leave no visible
trace until heat or some chemical is applied to the paper.
Pin punctures – small pin punctures on selected letters are ordinarily not visible
unless the paper is held in front of the light.
Typewritten correction ribbon – used between the lines typed with a black
ribbon, the results of typing with the correction tape are visible only under a strong
light.

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.

Classic Cryptography Modern Cryptography

It manipulates traditional characters, It operates on binary bit


i.e., letters and digits directly. sequences.

It is mainly based on ‘security It relies on publicly known


through obscurity’. mathematical algorithms for
coding the information.
It requires the entire cryptosystem for Modern cryptography requires
communicating confidentially. parties interested in secure
communication to possess the
secret key only.
Assignment Unit I

Real life case study

1. Do you think that necessity of keeping files secure arises more during COVID
lockdown? (k4,CO1)

2. Is our Data is secure in Social media Networks ? Discuss (k4,CO1)


3. Healthcare finds a vital role for cryptography. Justify. (k4,CO1)
TWO MARKS Q & A

Define cryptography .(CO1,K1)


Cryptography is associated with the process of converting ordinary plain text into

unintelligible text and vice-versa. It is a method of storing and transmitting data


in a particular form so that only those for whom it is intended can read and process

it. Cryptography not only protects data from theft or alteration, but can also be used

for user authentication.

Define cryptanalysis. (CO2,K1)


Techniques used for deciphering a message without any knowledge of the
enciphering details fall into the area of cryptanalysis. Cryptanalysis is what the

layperson calls “breaking the code.”

Define security Attack, mechanism and service. (CO1,K1)


Security attack: Any action that compromises the security of information owned

by an organization.
Security mechanism: A process (or a device incorporating such a process) that

is designed to detect, prevent, or recover from a security attack.

Security service: A processing or communication service that enhances the

security of the data processing systems and the information transfers of an

organization. The services are intended to counter security attacks, and theymake

use of one or more security mechanisms to provide the service.


Distinguish Threat and Attack .(CO1,K1)
Threat -A potential for violation of security, which exists when there is a

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.

Differentiate active attacks and passive attacks. (CO1,K1)


A passive attack attempts to learn or make use of information from the system
but does not affect system resources. Two types of passive attacks are the release
of message contents and traffic analysis.
An active attack attempts to alter system resources or affect their operation. It
can be subdivided into four categories: masquerade, replay, modification of
messages, and denial of service.

What is an unconditionally secure cipher? (CO1,K1)


An unconditionally secure cipher is one that does not contain enough information
to determine uniquely the corresponding plaintext, no matter how much ciphertext
is available. That is, no matter how much time an opponent has, it is impossible for
him to decrypt the ciphertext, simply because the required information is not there.
Example: One-time pad
Differentiate block and stream cipher (CO1,K1)
A block cipher processes the input one block of elements at a time, producing an
output block for each input block. A stream cipher processes the input elements
continuously, producing output one element at a time, as it goes along.

What are the essential ingredients of a symmetric cipher?(CO1,K1)


➢ Plain Text
➢ Encryption algorithm
➢ Secret Key
➢ Decryption algorithm
➢ Cipher text

Specify four categories of security threats (CO1,K1)


➢ Interruption
➢ Interception
➢ Modification
➢ Fabrication

What is brute-force attack? (CO1,K1)


The attacker tries every possible key on a piece of cipher text until an intelligible
translation into plaintext is obtained. On average, half of all possible keys must be
tried to achieve success.

List the types of cryptanalysis attack (CO2,K1)


➢ Cipher text only
➢ Known plain text
➢ Chosen plaintext
➢ Chosen cipher text
➢ Chosen text
Compare Substitution and Transposition techniques. (CO2,K1)
A substitution technique is one in which the letters of plaintext are replaced by
other letters or by numbers or symbols.1 If the plaintext is viewed as a sequence
of bits, then substitution involves replacing plaintext bit patterns with cipher text bit
patterns.

Example: Caesar cipher, monoalphabetic cipher, Playfair cipher,


In transposition technique, 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.

Example: rail fence

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.

What is a computationally secure cipher?(CO1,K1)


A computationally secure cipher is one which satisfies any one of the following
two criteria:

➢ 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 two problems with the one-time pad?(CO2,K1)


➢ Generating large quantities of random keys.
➢ Key distribution and protection.
Compare Vernam Cipher and One-time Pad(CO2,K1)
VERNAM CIPHER
➢ Key is eventually repeated
➢ It works on binary data rather than letters.
ONE-TIME PAD
➢ Key never repeated
➢ It works on letters.

What are the techniques that have been used historically for
steganography?(CO2,K1)

➢ Character marking
➢ Invisible ink
➢ Pin punctures
➢ Typewriter correction ribbon

What are the two general approaches to attacking a cipher?(CO1,K1)


➢Cryptanalysis: Cryptanalytic attacks rely on the nature of the algorithm plus
perhaps some knowledge of the general characteristics of the plaintext or even
some sample plaintext-ciphertext pairs.

➢Brute-force attack: The attacker tries every possible key on a piece of


cipher-text until an intelligible translation into plaintext is obtained. On average, half
of all possible keys must be tried to achieve success.

What are the various types of cryptanalytic attacks?(CO2,K1)


➢ Ciphertext only
➢ Known Plaintext
➢ Chosen plaintext
➢ Chosen ciphertext
➢ Chosen text
What is computer crime?(CO1,K1)
Computer crime, or cybercrime, is a term used broadly to describe criminal activity
in which computers or computer networks are a tool, a target, or a place of criminal
activity.

List the types of computer crime. (CO1,K1)


➢ Computers as targets
➢ Computers as storage devices
➢ Computers as communications tools

What is Modern cryptography?(CO2,K1)


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.

What are the characteristics of Modern Cryptography? (CO2,K1)


➢ It operates on binary bit sequences.
➢ It relies on publicly known mathematical algorithms for coding the information.
➢ Modern cryptography requires parties interested in secure communication to
possess the secret key only.

What is Symmetric Key Encryption? (CO1,K1)


The encryption process where same keys are used for encrypting and decrypting
the information is known as Symmetric Key Encryption. The study of symmetric
cryptosystems is referred to as symmetric cryptography. Symmetric cryptosystems
are also sometimes referred to as secret key cryptosystems

What is Asymmetric Key Encryption? (CO1,K1)


The encryption process where different keys are used for encrypting and
decrypting the information is known as Asymmetric Key Encryption.
Part B
1. Explain the following: (CO1, K2)
(a) Playfair cipher.
(b) Vernam cipher in detail.
2. Discuss in detail about Steganography (CO1, K2)
3. Compute the ciphertext for the plaintext “SECURE WORLD” using the playfair
cipher with key “CRYPTO. Also verify whether it is feasible to generate back the
plaintext, (CO1, K3)

4. ”Explain the OSI security architecture. (CO1, K2)


5. Explain various transposition ciphers in detail. (CO1, K2)
6. Explain in detail about various types of attacks. (CO1, K2)
7. Explain in detail about the model of Network Security. (CO1,K2)
7. Compute the ciphertext using Hill cipher for the plaintext “PAY ORE MONEY”and
key given below. Verify whether your ciphertext reproduces plaintext. (CO1,K3)
Supportive online Certification courses

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

Complete Cryptography master class


Real time Applications in day to day life and to Industry

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

Post quantum Cryptography


Light-weight Cryptography
Cloud security homomorphic encryption
Leakeage resilient Cryptography
Prescribed Text Books & Reference Books
TEXT BOOK:
William Stallings, Cryptography and Network Security: Principles and Practice, PHI
3rd Edition, 2020.

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)

5. Detection of Abnormal traffic Pattern in Network


6. A visualization of zero-knowledge proofs
7. Design and prevention of side-channel attacks.
8. Visualization of different methods of steganography.
9.Improving the classic algorithms, e. g. by implementing the transformation page as a
core part of the wizards.
10.Design a user-friendly command-line or simple graphical user interface for the toolkit
and Include options for users to choose the encryption or decryption mode.
11.Implement the Caesar Cipher algorithm and Allow users to specify the shift value.
12.Implement the Vigenère Cipher algorithm and Allow users to enter a keyword.
13.Implement the Playfair Cipher algorithm and Handle both encryption and decryption for
Playfair.

14.Implement the Hill Cipher algorithm and Allow users to input the matrix key.
ASSESSMENT SCHEDULE

S.NO Name of the Assessment Portion Proposed Date

1 First Internal Assessment Unit-1 &Unit 2 12.02.2024

2 Second Internal Assessment Unit-3 &Unit 4 12.04.2024

3 Model Examination Unit 1-Unit 5 04.05.2024


Thank you

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.

You might also like