0% found this document useful (0 votes)
43 views40 pages

CNS Unit 1 FS

Computer network sequrity
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views40 pages

CNS Unit 1 FS

Computer network sequrity
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Cryptography and Network Security

Unit - 1

Introduction

FutureScopie
Topics
Introduction to Security attacks, services and mechanism
Classical encryption techniques-Substitution ciphers and Transposition
ciphers
Cryptanalysis
Steganography
Stream and Block Ciphers
Modern Block Ciphers: Block ciphers principles
Shannon’s theory of confusion and diffusion
Feistel structure
Data Encryption Standard (DES)
Strength of DES
Triple DES
Idea of Differential Cryptanalysis
Block cipher modes of operations
Cryptography:
Cryptography is the science and art of creating secret code.

Cryptography is defined as the conversion of data into a scrambled code


that can be decrypted and send across a public or private network.

Cryptography is like a secret code that keep your messages safe when
you send them online or store them on a computer.
Type of Cryptography:
There are two main types of Cryptography:-

Symmetric Key Cryptography: This method involves using the same key for both
encryption and decryption. The sender and receiver both possess this secret key
to encrypt and decrypt messages. Examples are AES (Advance Encryption
Standard) and DES (Data Encryption Standard).

Asymmetric Key Cryptography: This method uses a pair of keys (i.e. a public key
and a private key) for encryption and decryption. The public key is freely
distributed while the private key remains secret. Message encrypted with the
public key can be decrypted using the corresponding private key. Examples can
be RSA (Rivest-Shamir-Adleman) and ECC (Elliptic Curve Cryptography)
Security Services:
Confidentiality: The principle of confidentiality specifies that only the
sender and the intended recipient should be able to access the content of
the message. It protects the transmitted data from passive attack.
Non-repudiation: It is a condition when a user sends message and later
refuses that he had not sent the message. The principle of non-repudiation
doesn‘t allow the sender of message to deny that he had not send the
message
Access Control: The principle of access control determines who should be
able to access data or system via communication link. It provides the
prevention of unauthorized use of resources.
Authentication: Authentication is concerned with assuring that a
communication is authentic. In authentication, there is an assurance that
the communication entity is the one that it claims to be.

Data Integrity: Data Integrity is designed to protect data from modification,


insertion, deletion and replaying by any entity. Data integrity can be
applied to a stream of message, a single message or a selected portion
within a message.
Security Attacks:
Attempt to gain unauthorized access to information.

Threat to Confidentiality
Snooping: Unauthorized access of data.
Traffic Analysis: Analyzing encoded messages to come up with likely
patterns.

Threat to Availability
Denial of Services (DoS): Slow down or totally interrupt the services of
a system.
Threat to Integrity
Modification: Modification in information to make it beneficial to
himself.
Masquerading: aka spoofing, it happens when one entity pretends to be
a different entity.
Replaying: Attacker obtains a copy of the message sent by a user and
later retransmits it to produce an unauthorized effect.
Repudiation: The sender of the message may deny that he has sent the
message or the receiver might later deny that he has received the
message.
Security Mechanisms
Data Integrity: Designed to protect data from modification, insertion,
deletion and replaying by any entity.
Encipherment: Hiding or covering data can provide confidentiality.
Digital Signature: Sender can digitally sign the data and receiver can
digitally verify the signature.
Access Control: Determines who should be able to access data or
system via communication link.
Traffic Padding: Way of inserting of bits into gaps in a data stream to
confuse traffic analysis attempts.
Notarization: Selecting a third party to control the communication
between two entities.
Cryptanalysis
Cryptanalysis means the decryption and analysis of codes, ciphers or
encrypted text.
Types of Cryptanalysis

Cipher Only Attack Chosen Plaintext Attack

Known Plaintext Attack Chosen Ciphertext Attack


Cryptanalysis

Cipher only attack:


Only encrypted message is available for attack.
In this situation, Attacker doesn’t know anything about content of message
and must work from cipher text only.
Cryptanalysis

Known plaintext attack:


both plaintext and matching cipher text are available for use in discovering
key.
The attacker knows or can guess the plaintext for some parts of cipher text.
Cryptanalysis

Chosen Plaintext Attack:


It happens when attacker gains access to target encryption.
In Adaptive Chosen Plaintext Attack, attacker can adapt or modify the
chosen plaintext as needed based on the result of the previous result.
Cryptanalysis

Chosen Ciphertext Attack:


Cryptanalyst can choose different cipher texts to be decrypted and has
access to the plaintext.
This type of attack is generally applicable to attacks against public key
cryptosystem.
Comparison Substitution Technique Transposition Technique
Basic Replacing Plaintext elemets with Rearranges the position of the
other elements. characters of the plaintext.
Forms Monoalphabetic and Polyalphabetic Keyless and keyed transpositional
substitution cipher. cipher.
Demerits The letter with the low frequency Keys near to correct key can
can detect the plaintext. disclose the plaintext.
Implement Can be easier to implement. Complex due to rearrangement
ation mechanisms.
Manipulati Replaces characters based on fixed Rearranges elements based on
on Type rule or mapping. specific patterns or keys.
Examples Ceasar Cipher, Columnar Transposition,
Monoalphabetic Cipher, Rail Fence Cipher
Polyalphabetic Cipher
Steganography
Steganography is a technique to implement security mechanisms.
In this technique, data is hidden within an ordinary, nonsecret file or
message to avoid detection.
It is the technique of writing a message in such a way that apart from
the sender and the receiver, no one will suspect the existence of the
message.
It enables the sender to hide a message inside another message.
Cryptography conceals the contents of message by enciphering, and
steganography conceals the message itself by covering it with
something.
Steganography
Traditional Techniques of Steganography:
Marking selected letters of a printed document with a pencil such that
the marks are visible only when the document is exposed at a specific
angle to bright light.
Use of some invisible ink to write a secret message such that the
contents of a message are not visible until heated or some other
chemical is applied.
Use of interodots or pin punchers on selected letters.
Some modern techniques of steganography includes hiding of a secret
message within an image, audio or video file.
Block Cipher
Block Cipher is defined as a symmetric key cipher where a group of
plaintext symbols are encrypted together to create a group of
ciphertext of same size.
During decryption, each ciphertext block is converted to plaintext
block, one block at a time.
It uses either 64 bits or more than 64 bits.
The complexity of block cipher is simple.
Reverse encrypted text is hard in block cipher.
Block cipher works on transposition techniques.
It is slow as compared to stream cipher.
Suitable for application that require strong encryption, such as file
storage and internet communication.
More Secure.
Stream Cipher
Stream Cipher is defined as symmetric key cipher where encryption and
decryption are done on one symbol at at time.
It converts plaintext into cipher text by taking 1 byte of plaintext at a
time.
Stream Cipher uses 8 bits.
The values depend on the plaintext, ciphertext characters and previous
key values.
These are designed to approximate an idealized cipher, knows as One-
Time Pad.
Stream Cipher are more complex.
Reverse encrypted text is easy.
Stream Cipher works on substitution techniques.
It is faster as compared to Block Cipher.
Modern Block Cipher
A Modern Block Cipher is a symmetric key encryption algorithm that
operates on fixed-size blocks of data, typically in chunks of 64 or 128
bits.
The encryption or decryption algorithm uses a k-bit key.
Modern Block Cipher
Components of Modern Block Cipher:
1. S-Boxes: This is substitution box where substitution of several bits is
performed in parallel. It takes n bits of plaintext at a time as input and
produces m bits of ciphertext as output, where the value of n and m
maybe the same or different.
2. P-Boxes: This is permutation box that performs transportation at bit-
level, and transposition of several bits is performed at the same time.
3. Circular Shift: Bits can be shifted either in the left or in the right
direction.
Shannon’s Theory
It used the theory of confusion and diffusion for transposition and
substitution operations.

Confusion:
The property of confusion hides the relationship between the ciphertext
and the key.
This property makes it difficult to find the key from the ciphertext.
If a single bit in key is changed, then most or all the bits in the ciphertext
will be changed.
Increases ambiguity of ciphertext.
Achieved through substitution algorithm.
Used by stream cipher and block cipher.
Shannon’s Theory
Diffusion:
Hides the relationship between the ciphertext and the plaintext.
This will frustrate the attacker who tries to find out the plaintext from
the statistical analysis of ciphertext.
If a single symbol in the plaintext is changed, then several or all symbols
in the ciphertext will also be changed.
Increases the redundancy of the plaintext by spreading it across rows
and columns.
Achieved through transpositional algorithm.
Used by block cipher only.
Feistel Structure
The Feistel Structure is cryptographic construction.
Used in design of block ciphers.
Introduced by Horst Feistel in early 1970s.
Feistel Structure is adopted widely in various encryption algorithm due
to its simplicity and effectiveness.
It is commonly known as Feistel Network.
Advantages of feistel structure is that encryption and decryption
operations are very similar, and even identical is some cases.
A Feistel network is an iterated cipher with an internal function called a
round function.
Data Encryption Standard(DES)
The Data Encryption Standard (DES) is a symmetric-key block cipher.
Published by National Institute of Standards and Technology (NIST).
DES is an implementation of Feistel Cipher.
It uses 16 round Feistel structure.
The block size is 64 bit.
Key length is 64 bit, DES has effective key length of 56 bits.
8 of the 64 bits are not used in encryption algorithm.
These 8 bits act as check bits only.
DES is a symmetric cryptosystem, specifically a 16 round Feistel cipher.
These are required to specify DES:
Round Function Key Schedule Initial and Final Permutation
Data Encryption Standard(DES)

Block Diagram of DES algorithm


Data Encryption Standard(DES)
Step 1: 64 bit plaintext block is passed to Initial Permutation function (IP).
Step 2: Initial Permutation is performed on plaintext.
Step 3: IP produces to halves; Left Plain Text (LPT) and Right Plain Text
(RPT).
Step 4: Each of LPT and RPT go through 16 rounds of encryption process.
Step 5: In the end, LPT and RPT are rejoined and a Final Permutation is
performed on combined block.
Step 6: The result of this process produces 64 bit ciphertext.

Functionality of DES: Generally used for encrypting plaintext messages in


various algorithm modes such as Electronic Code Book (ECB), Cipher Block
Chaining (CBC), Cipher Feedback (CFB), and Output Feedback (OFB).
Strength of DES
1. The inner workings of DES algorithm are completely known. The
strength of DES lies only in key, which must be secret.
2. It uses 56 bit key in encryption and there are 2^56 possible keys. A brute
force attack on such number of keys are impractical.
Triple DES
Triple DES is a encryption technique which uses three instance of DES
on same plaintext.
It uses there different types of key choosing technique in first all used
keys are different and in second two keys are same and one is different
and in third all keys are same.
The primary idea behind Triple DES is to increase the effective key size
while still utilizing the existing DES algorithm.
Instead of using a single 56-bit key for encryption, Triple DES applies
either two or three 56-bit key in different modes.
There are two keying option in Triple DES (3DES):
Triple DES with two keys Triple DES with three keys
Triple DES
Triple DES with two keys:
Two different 56-bit keys are used in a specific order.
Suppose two different keys are K1 and K2, then the order is encryption
with K1, decryption with K2, and then encryption again with K1.
This results in an effective key length of 112-bits.

Triple DES with three keys:


This mode uses three different 56-bit keys.
Suppose three different keys are K1, K2, and K3.
The data is encrypted with K1, decrypted with K2, and then encrypted
again with K3.
This results in effective key length of 168-bits.
Differential Cryptanalysis
Introduced first in 1990 by Eli Biham and Adi Shamir.
Differential Cryptanalysis can work on multiple bits at a time.
Differential Cryptanalysis is a general model of cryptanalysis applicable
to block cipher.
It can also be applicable to stream ciphers and cryptographic hash
function.
It may be used to decrypt both block and stream ciphers, and
cryptographic hash function.
The main objective of differential cryptanalysis is to view for patterns in
ciphertext to provide deduce details about the key used in cipher.
Plaintext attack is advantages in differential cryptanalysis.
Complexity of attack is High in differential cryptanalysis.
Goal of the attack is to identify some bits of the unknown key.
Block Cipher mode of operations
Block cipher modes of operation are techniques used to encrypt
plaintext data of arbitrary length using a block cipher algorithm that
typically operates on fixed-size blocks of data.
Some common block cipher modes of operations are listed below:
Cipher Feedback Mode (CFB)
Electronic Codebook Mode (ECB)
Ciphertext Block Chaining Mode (CBC)
Output Feedback Mode (OFB)
Counter Mode
Block Cipher mode of operations

Cipher Feedback Mode (CFB)


CFB mode is used where block size are smaller in size.
The ciphertext is fed back into the encryption process in encrypt the
next block.
Block Cipher mode of operations
Electronic Codebook Mode (ECB)
This is the simplest mode.
The plaintext is divided into N blocks. The block size is n-bits.
If plaintext size is less than multiple of n then extra padding is used in
last block.
Identical plaintext blocks encrypt to identical ciphertext blocks, which
might reveal patterns in encrypted data.
The same key is used to encrypt and decrypt each block.
For length messages, the ECB mode may not be secure.
Block Cipher mode of operations
Ciphertext Block Chaining Mode (CBC)
Ciphertext Block Chaining or CBC is an advancement made on ECB since
ECB compromises some security requirements.
Each plaintext block is combined with the previous ciphertext block
before encryption.
Each plaintext block is XOR with the previous ciphertext block before
being encrypted.
Initialization Vector (IV) is used for the first block to add randomness
and prevent repetition patterns.
Block Cipher mode of operations
Output Feedback Mode (OFB)
OFB is very similar to CFB mode, with one difference.
Each bit of the ciphertext is independent of the previous bit. This avoid
flow of error from one block to another.
It converts a block cipher into a synchronous stream cipher.
Advantage of OFB is that bit errors in transmission do not propagate.
Disadvantage of the OFB is that it is more vulnerable to a message
stream modification attack than is CFB.
Block Cipher mode of operations
Counter Mode (CTR)
The Counter Mode or CTR is a simple counter-based block cipher
implementation.
A counter equal to the plaintext block size is used.
For encryption, the counter is encrypted and then XORed with the
plaintext block to produce the ciphertext block.
For decryption, same sequence of counter values is used, with each
encrypted counter XORed with ciphertext block.
It is used in hardware and software efficiency, preprocessing, security
and simplicity.
Previous Year Questions (2 Marks)

Ques. Differentiate between Substitution and Transposition Cipher?


Ques. What do you mean by cryptanalysis?
Ques. Explain Shannon Confusion and Diffusion.
Ques. Define the concept of Confusion and Diffusion.
Ques. Define CIA?
Ques. What do you mean by Brute Force Attack?
Previous Year Questions (10 Marks)
1. Explain the concept of block cipher and stream cipher in cryptography.
Discuss the modes of operations of block cipher.
2. Explain Playfair technique and encrypt the following message “hide the
gold in the treestump” using the key - “playfair”.
3. Draw a block level diagram to depict the signature of one round of DES.
Prove that if plaintext block and encryption key are complemented then
resulting ciphertext block of DES encryption is also complemented.
4. Differentiate between monoalphabetic ciphers and polyalphabetic
ciphers and give one example for each.
5. What is the most security-critical component of DES round function?
Give brief description of this function.
THANK YOU
LIKE &
SO MUCH!
SUBSCRIBE

You might also like