Network Security Unit 1
Network Security Unit 1
INTRODUCTION
Security:
Security is a broad and crucial concept that encompasses various measures and practices
designed to protect individuals, organizations, systems, and data from threats, attacks, and
unauthorized access. It is a multidimensional field that spans physical, digital, and information
security. Here are some key aspects of security:
1. Cybersecurity:
Focuses on safeguarding computer systems, networks, and data from cyber threats.
Includes measures such as firewalls, antivirus software, encryption, and regular software
updates.
2. Network Security:
Concerned with securing communication networks to prevent unauthorized access, data
interception, and other network-based attacks.
Involves the use of firewalls, intrusion detection/prevention systems, and virtual private
networks (VPNs).
3. Information Security:
Encompasses the protection of sensitive information and data.
Involves data encryption, access controls, secure data storage, and employee training on
data handling.
1.Basics Of Cryptography:
Cryptography:
According to “Phil Zimmermann”,
- Cryptography is the science of using mathematics to encrypt and decrypt data.
Terminologies Of Cryptography:
1. Cipher:
A system or algorithm for encrypting and decrypting data.
2. Encryption:
The process of converting plaintext (unencrypted data) into ciphertext (encrypted data)
using an algorithm and a key.
3. Decryption:
The process of converting ciphertext back into plaintext using the appropriate key.
4. Key:
A parameter used in cryptographic algorithms to control the transformation of plaintext
into ciphertext (encryption) or vice versa (decryption).
5. Symmetric Key Cryptography:
A type of cryptography where the same key is used for both encryption and decryption.
6. Asymmetric Key Cryptography (Public Key Cryptography):
A type of cryptography that uses a pair of public and private keys. The public key is
used for encryption, while the private key is used for decryption.
7. Public Key:
The key in an asymmetric key pair that is shared openly and is used for encryption.
8. Private Key:
The key in an asymmetric key pair that must be kept secret and is used for decryption.
9. Hash Function:
A one-way mathematical function that transforms input data into a fixed-size string of
characters, often used for data integrity verification.
10. Digital Signature:
A cryptographic technique that verifies the authenticity and integrity of a message or
document using a digital key pair.
11. Certificate Authority (CA):
A trusted entity that issues digital certificates to verify the ownership of a public key.
12. Digital Certificate:
A digitally signed document that binds a public key to an individual or entity, providing
a means for others to verify the authenticity of the public key.
13. Plaintext:
The original, unencrypted text or data.
14. Ciphertext:
The encrypted output resulting from applying an encryption algorithm to plaintext using
a key.
15. Cryptanalysis:
The study of techniques to break cryptographic systems or to find weaknesses in them.
16. Nonce:
A "number used once," often a random or pseudo-random value, used to protect against
certain types of attacks in cryptographic protocols.
17. Zero-Knowledge Proof:
A cryptographic method where one party proves to another that they know a specific
piece of information without revealing the information itself.
18. Man-in-the-Middle (MitM) Attack:
An attack where an adversary intercepts and potentially alters the communication
between two parties without their knowledge.
The OSI security architecture focuses on security attacks, mechanisms, and services.
These can be defined briefly as follows:
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.
Security Trends:
The protection afforded to an automated information system in order to attain the applicable
objectives of preserving the integrity, availability, and confidentiality of information system
resources (includes hardware, software, firmware, information/ data, and telecommunications)
This definition introduces three key objectives that are at the heart of computer security:
• Confidentiality: This term covers two related concepts:
Data confidentiality: Assures that private or confidential information is not made available
or disclosed to unauthorized individuals.
Privacy: Assures that individuals control or influence what information related to them may
be collected and stored and by whom and to whom that information may be disclosed.
• Integrity: This term covers two related concepts:
Data integrity: Assures that information and programs are changed only in a specified and
authorized manner.
System integrity: Assures that a system performs its intended function in an unimpaired
manner, free from deliberate or inadvertent unauthorized manipulation of the system.
• Availability: Assures that systems work promptly and service is not denied to authorized
users
These three concepts form what is often referred to as the CIA triad.
CIA Triad
Security Attack:
There are two types of attacks
Passive attacks
Active attacks
Passive attack
Passive attacks attempt to learn or make use of information from the system
but do not affect system resources. The goal of the opponent is to obtain information
that is being transmitted.
Release of message contents: The opponent would learn the contents of the
transmission. 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.
Traffic analysis: The opponent could determine the location and identity of
communicating hosts 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. Passive attacks are very difficult to
detect, because they do not involve any alteration of the data. However, it is
feasible to prevent the success of these attacks.
Active attacks
These attacks involve some modification of the data stream or the creation of a false
stream.
Active attacks can be classified in to four categories:
Masquerade – One entity pretends to be a different entity. Here, the attacker
capturers the authentication and impersonifies the sender.
Replay – The attacker captures the message and retransmits the message without
modification to produce unauthorized effect.
Modification of messages – The attacker captures the message and retransmits the
message with modification to produce unauthorized effect.
Denial of service – The attacker may suppress all messages directed to a particular
destination. Another 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 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.
ACTIVE ATTACK VS PASSIVE ATTACK:
Due to active attacks, the execution system is While due to passive attack, there is no harm to the
always damaged. system.
In an active attack, Victim gets informed While in a passive attack, Victim does not get informed
about the attack. about the attack.
In an active attack, System resources can be While in passive attack, System resources are not
changed. changing.
Active attack influences the services of the While in a passive attack, information and messages in
system. the system or network are acquired.
An active attack is tough to restrict from Passive Attack is easy to prohibit in comparison to active
entering systems or networks. attack.
In an active attack, information collected While passive attacks are performed by collecting
through passive attacks is used during information such as passwords, and messages by
execution. themselves.
The purpose of an active attack is to harm the The purpose of a passive attack is to learn about the
ecosystem. ecosystem.
The duration of an active attack is short. The duration of a passive attack is long.
THREATS VS ATTACK:
THREAT ATTACK
Circumstance that has the ability to cause damage Objective is to cause damage
Can be classified into Physical threat, internal Can be classified into Virus, Spyware, Phishing,
threat, external threat, human threat, and non- Worms, Spam, Botnets, DoS attacks, Ransomware,
physical threat. Breaches.
A message is to be transferred from one party to another across some sort of internet.
The two parties, who are the principals in this transaction, must cooperate for the
exchange to take place. A logical information channel is established by
defining a route through the internet from source to destination
and by thecooperative use of communication protocols (e.g.,
TCP/IP) by the two principals.
1. Plain text –
It is the original data that is given to the algorithm as an input.
2. Encryption algorithm –
This encryption algorithm performs various transformations on plain text to
convert it into ciphertext.
3. Secret key –
The secret key is also an input to the algorithm. The encryption algorithm
will produce different outputs based on the keys used at that time.
4. Ciphertext –
It contains encrypted information because it contains a form of original
plaintext that is unreadable by a human or computer without proper cipher
to decrypt it. It is output from the algorithm.
5. Decryption algorithm –
This is used to run encryption algorithms in reverse. Ciphertext and Secret
key is input here and it produces plain text as output.
Advanced Encryption Standard (AES)
AES performs operations on bytes of data rather than in bits. Since the block
size is 128 bits, the cipher processes 128 bits (or 16 bytes) of the input data at
a time.
SubBytes
ShiftRows
MixColumns
Add Round Key
SubBytes :
This step implements the substitution.
In this step each byte is substituted by another byte. Its performed using a
lookup table also called the S-box. This substitution is done in a way that a
byte is never substituted by itself and also not substituted by another byte
which is a compliment of the current byte. The result of this step is a 16 byte
(4 x 4 ) matrix like before.
ShiftRows :
This step is just as it sounds. Each row is shifted a particular number of times.
The first row is not shifted
The second row is shifted once to the left.
The third row is shifted twice to the left.
The fourth row is shifted thrice to the left.
(A left circular shift is performed.)
[ b0 | b1 | b2 | b3 ] [ b0 | b1 | b2 | b3 ]
| b4 | b5 | b6 | b7 | -> | b5 | b6 | b7 | b4 |
| b8 | b9 | b10 | b11 | | b10 | b11 | b8 | b9 |
[ b12 | b13 | b14 | b15 ] [ b15 | b12 | b13 | b14 ]
MixColumns :
This step is basically a matrix multiplication. Each column is multiplied with a
specific matrix and thus the position of each byte in the column is changed as
a result.
This step is skipped in the last round.
[ c0 ] [ 2 3 1 1 ] [ b0 ]
| c1 | = |1 2 3 1| | b1 |
| c2 | |1 1 2 3| | b2 |
[ c3 ] [3 1 1 2] [ b3 ]
Add Round Keys :
Now the resultant output of the previous stage is XOR-ed with the
corresponding round key. Here, the 16 bytes is not considered as a grid but just
as 128 bits of data.
After all these rounds 128 bits of encrypted data is given back as output. This
process is repeated until all the data to be encrypted undergoes this process.
Decryption :
The stages in the rounds can be easily undone as these stages have an opposite
to it which when performed reverts the changes.Each 128 blocks goes through
the 10,12 or 14 rounds depending on the key size.
The stages of each round in decryption is as follows :
Applications:
AES is widely used in many applications which require secure data storage
and transmission. Some common use cases include:
With the spread of more unsecure computer networks in last few decades, a
genuine need was felt to use cryptography at larger scale. The symmetric key
was found to be non-practical due to challenges it faced for key management.
This gave rise to the public key cryptosystems.
Different keys are used for encryption and decryption. This is a property
which set this scheme different than symmetric encryption scheme.
Each receiver possesses a unique decryption key, generally referred to as
his private key.
Receiver needs to publish an encryption key, referred to as his public key.
Some assurance of the authenticity of a public key is needed in this
scheme to avoid spoofing by adversary as the receiver. Generally, this
type of cryptosystem involves trusted third party which certifies that a
particular public key belongs to a specific person or entity only.
Encryption algorithm is complex enough to prohibit attacker from
deducing the plaintext from the ciphertext and the encryption (public)
key.
Though private and public keys are related mathematically, it is not be
feasible to calculate the private key from the public key. In fact,
intelligent part of any public-key cryptosystem is in designing a
relationship between two keys.
There are three types of Public Key Encryption schemes. We discuss them in
following sections −
RSA Cryptosystem
We will see two aspects of the RSA cryptosystem, firstly generation of key pair
and secondly encryption-decryption algorithms.
Example
Once the key pair has been generated, the process of encryption and decryption
are relatively straightforward and computationally easy.
RSA Encryption
Suppose the sender wish to send some text message to someone whose
public key is (n, e).
The sender then represents the plaintext as a series of numbers less than
n.
To encrypt the first plaintext P, which is a number modulo n. The
encryption process is simple mathematical step as −
C = Pe mod n
In other words, the ciphertext C is equal to the plaintext P multiplied by
itself e times and then reduced modulo n. This means that C is also a
number less than n.
Returning to our Key Generation example with plaintext P = 10, we get
ciphertext C −
C = 105 mod 91
RSA Decryption
RSA Analysis
The security of RSA depends on the strengths of two separate functions. The
RSA cryptosystem is most popular public-key cryptosystem strength of which is
based on the practical difficulty of factoring the very large numbers.
The strength of RSA encryption drastically goes down against attacks if the
number p and q are not large primes and/ or chosen public key e is a small
number.
Hash functions
Hash functions are extremely useful and appear in almost all
information security applications.
A hash function is a mathematical function that converts a
numerical input value into another compressed numerical value.
The input to the hash function is of arbitrary length but output is
always of fixed length.
Values returned by a hash function are called message digest or
simply hash values. The following picture illustrated hash
function −
Features of Hash Functions
The typical features of hash functions are −
Digital Signatures
Encryption – Process of converting electronic data into another form,
called ciphertext, which cannot be easily understood by anyone except
the authorized parties. This assures data security. Decryption– Process
of translating code to data.
The message is encrypted at the sender’s side using various