CNS - Unit 1
CNS - Unit 1
Security Attacks
Security attacks refer to the sets of actions that the threats actors perform to gain any
unauthorized access, cause damage to systems/computers, steal data, or compromise the
computer networks.
Active attacks
An Active attack attempts to alter system resources or affect their operations.
Active attacks involve some modification of the data stream or the creation of
false statements.
Active attacks involve an attacker intentionally altering or destroying data, or
disrupting the normal operation of a system.
Examples of active attacks include denial of service (DoS), where an attacker
floods a system with traffic in an attempt to make it unavailable to legitimate
users, and malware, where an attacker installs malicious software on a system to
steal or destroy data.
1
Unit -1 Cryptography and Network Security
Masquerade
A masquerade attack takes place when one entity pretends to be a different entity.
If an authorization procedure isn’t always absolutely protected, it is able to grow
to be extraordinarily liable to a masquerade assault.
Masquerade assaults may be performed using the stolen passwords and logins
Modification of messages
Some portion of a message is altered or that message is delayed or reordered to
produce an unauthorized effect.
Modification is an attack on the integrity of the original data. It basically means
that unauthorized parties not only gain access to data but also spoof the data by
triggering, such as altering transmitted data packets or flooding the network with
fake data.
2
Unit -1 Cryptography and Network Security
Replay Attack
It involves the passive capture of a message and its subsequent transmission to
produce an authorized effect.
In this attack, the basic aim of the attacker is to save a copy of the data originally
present on that particular network and later on use this data for personal uses.
Denial of Service
Form of service denial is the disruption of an entire network either by disabling
the network or by overloading it with messages so as to degrade performance.
It prevents the normal use of communication facilities. This attack may have a
specific target. For example, an entity may suppress all messages directed to a
particular destination.
3
Unit -1 Cryptography and Network Security
Passive attacks
A Passive attack attempts to learn or make use of information from the system
but does not affect system resources.
Passive attacks involve an attacker passively monitoring or collecting data
without altering or destroying it.
Examples of passive attacks include eavesdropping, where an attacker listens in
on network traffic to collect sensitive information, and sniffing, where an
attacker captures and analyzes data packets to steal sensitive information.
Traffic analysis –
Suppose that we had a way of masking (encryption) information, so that the
attacker even if captured the message could not extract any information from the
message.
The opponent could determine the location and identity of communicating host
and could observe the frequency and length of messages being exchanged.
This information might be useful in guessing the nature of the communication
that was taking place
.
4
Unit -1 Cryptography and Network Security
Due to active attacks, the execution system While due to passive attack, there is no
is always damaged. harm to the system.
In an active attack, Victim gets informed While in a passive attack, Victim does not
about the attack. get informed about the attack.
In an active attack, System resources can While in passive attack, System resources
be changed. are not changing.
The duration of an active attack is short. The duration of a passive attack is long.
Security Services
6
Unit -1 Cryptography and Network Security
Authentication: The assurance that the communicating entity is the one that it claims to
be
Access Control
The prevention of unauthorized use of a resource (i.e., this service controls that
can have access to a resource, under what conditions access can occur, and what
those accessing the resource are allowed to do).
Data Integrity: Assurance that data received are exactly as sent by an authorized entity.
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.
7
Unit -1 Cryptography and Network Security
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 Mechanism
The mechanism that is built to identify any breach of security or attack on the
organization is called a security mechanism.
Security Mechanisms are also responsible for protecting a system, network, or device
against unauthorized access, tampering, or other security threats.
Security mechanisms can be implemented at various levels within a system or network
and can be used to provide different types of security, such as confidentiality, integrity,
or availability.
Some examples of security mechanisms include
Encipherment (Encryption) involves the use of algorithms to transform data
into a form that can only be read by someone with the appropriate decryption
key. Encryption can be used to protect data it is transmitted over a network, or to
protect data when it is stored on a device.
Digital signature is a security mechanism that involves the use of cryptographic
techniques to create a unique, verifiable identifier for a digital document or
message, which can be used to ensure the authenticity and integrity of the
document or message.
Traffic padding is a technique used to add extra data to a network traffic stream
in an attempt to obscure the true content of the traffic and make it more difficult
to analyze.
Routing control allows the selection of specific physically secure routes for
specific data transmission and enables routing changes, particularly when a gap
in security is suspected.
8
Unit -1 Cryptography and Network Security
9
Unit -1 Cryptography and Network Security
There are only two requirements that need to be met to perform encryption. They are,
1. Encryption Algorithm: There is a need for a very strong encryption algorithm that
produces cipher texts in such a way that the attacker should be unable to crack the
secret key even if they have access to one or more cipher texts.
2. Secure way to share Secret Key: There must be a secure and robust way to share
the secret key between the sender and the receiver. It should be leakproof so that the
attacker cannot access the secret key.
10
Unit -1 Cryptography and Network Security
Cryptography
Cryptanalysis
It is the study of the cryptographic algorithm and the breaking of those secret
codes. The person practicing Cryptanalysis is called a Cryptanalyst.
Cryptanalysis is the study of methods for obtaining the meaning of encrypted
information, without access to the secret information that is typically required to
do so. Typically, this involves knowing how the system works and finding a
secret key.
Cryptanalytic attacks
The attacks rely on nature of the algorithm and also knowledge of the general
characteristics of the plaintext and some plaintext- cipher text pairs.
It exploits the characteristics of the algorithm to attempt to derive specific
plaintext or derive the key.
Brute-force attack
This attack involves trying every possible key until the correct one is found.
While this attack is simple to implement, it can be time-consuming and
computationally expensive, especially for longer keys.
11
Unit -1 Cryptography and Network Security
In this type of attack, the attacker chooses random plaintexts and obtains the
corresponding cipher texts and tries to find the encryption key.
In this type of attack, only some cipher-text is known and the attacker tries to
find the corresponding encryption key and plaintext.
It’s the hardest to implement but is the most probable attack as only ciphertext is
required.
Substitution Techniques
Hiding some data is known as encryption. When plain text is encrypted it becomes
unreadable and is known as ciphertext. In a Substitution cipher, any character of plain
text from the given fixed set of characters is substituted by some other character from the
same set depending on a key.
Caesar Cipher
This the simplest substitution cipher by Julius Caesar.
In this substitution technique, to encrypt the plain text, each alphabet of the plain
text is replaced by the alphabet three places further it.
To decrypt the cipher text each alphabet of cipher text is replaced by the alphabet
three places before it.
13
Unit -1 Cryptography and Network Security
Example
Monoalphabetic Cipher
Monoalphabetic cipher is a substitution cipher, where the cipher alphabet for each
plain text alphabet is fixed, for the entire encryption.
In simple words, if the alphabet ‘p’ in the plain text is replaced by the cipher
alphabet ‘d’. Then in the entire plain text wherever alphabet ‘p’ is used, it will be
replaced by the alphabet ‘d’ to form the ciphertext.
Monoalphabetic ciphers are easy to break because they reflect the frequency data
of the original alphabet.
If the crpyanalyst know the original language, and we know that a monoalphabetic
substitution was used, then we have a good chance of cracking the code
14
Unit -1 Cryptography and Network Security
Playfair cipher
It initially creates a key-table of 5*5 matrix. The matrix contains alphabets that act as the
key for encryption of the plaintext. Note that any alphabet should not be repeated.
Another point to note that there are 26 alphabets and we have only 25 blocks to put a
letter inside it. Therefore, one letter is excess so, a letter will be omitted (usually J) from
the matrix. Nevertheless, the plaintext contains J, then J is replaced by I. It means treat I
and J as the same letter, accordingly.
First, split the plaintext into digraphs (pair of two letters). If the plaintext has the odd
number of letters, append the letter Z at the end of the plaintext. It makes the plaintext of
even For example, the plaintext MANGO has five letters. So, it is not possible to make a
digraph. Since, we will append a letter Z at the end of the plaintext, i.e. MANGOZ.
After that, break the plaintext into digraphs (pair of two letters). If any letter appears
twice (side by side), put X at the place of the second occurrence. Suppose, the plaintext is
COMMUNICATE then its digraph becomes CO MX MU NI CA TE. Similarly, the
digraph for the plaintext JAZZ will be JA ZX ZX, and for plaintext GREET, the digraph
will be GR EX ET
Fill the first row (left to right) with the letters of the given keyword. If the keyword has
duplicate letters (if any) avoid them. It means a letter will be considered only once. After
that, fill the remaining letters in alphabetical order.
Encryption Process
In this case, replace each letter of the digraph with the letters immediately to their right. If
there is no letter to the right, consider the first letter of the same row as the right letter.
In this case, replace each letter of the digraph with the letters immediately below them. If
there is no letter below, wrap around to the top of the same column.
If the alphabets are in different rows and columns, replace the pair with the alphabets on
the same row respectively but the corners of the rectangle defined by the original pair.
15
Unit -1 Cryptography and Network Security
Key: Keyword
Pair: me et me to mo rx ro wz
Cipher Text: kn ku kn kz ks ta kc yo
Example
1) Use playfair cipher to encrypt the word “greet” using the key “moon mission”= hqczdu
2) Use playfair cipher to encrypt the plaintext “why, don’t you? Using the key “keyword”=
yieaesvkez
3) Encrypt the message “surgical strike” with key “gujar” = paguudimtogamc
16
Unit -1 Cryptography and Network Security
Hill Cipher
17
Unit -1 Cryptography and Network Security
[e w]
n * n rectangle of a key then plaintext is converted into vector of length of n*1 (column wise/
vertical)
Example:
18
Unit -1 Cryptography and Network Security
Polyalphabetic Cipher
Vigenère Cipher
The encryption of the original text is done using the Vigenère square or Vigenère
table.
The table consists of the alphabets written out 26 times in different rows, each
alphabet shifted cyclically to the left compared to the previous alphabet,
corresponding to the 26 possible Caesar Ciphers.
At different points in the encryption process, the cipher uses a different alphabet
from one of the rows.
The alphabet used at each point depends on a repeating keyword.
19
Unit -1 Cryptography and Network Security
Vernam Cipher
Method to take key: In the Vernam cipher algorithm, we take a key to encrypt the
plain text whose length should be equal to the length of the plain text.
Encryption Algorithm:
Assign a number to each character of the plain-text and the key according to
alphabetical order.
Bitwise XOR both the number (Corresponding plain-text character number and
Key character number).
Subtract the number from 26 if the resulting number is greater than or equal to
26, if it isn’t then leave it.
Plaintext= HELLO
Key = NCBTA
H E L L O
7 4 11 11 14
N C B T A
13 2 1 19 0
SUM 20 6 12 30 14
SUM 20 6 12 04 14
U G M E O
For decryption subtract the key form cipher text if the answer is minus then add 26 into it
20
Unit -1 Cryptography and Network Security
21
Unit -1 Cryptography and Network Security
Transposition Techniques
The message is written out in rows of a fixed length, and then read out again
column by column, and the columns are chosen in some scrambled order.
Width of the rows and the permutation of the columns are usually defined by a
keyword.
22
Unit -1 Cryptography and Network Security
Security Objectives
23