Chapter 8 - Network Security
Chapter 8 - Network Security
Network Security
Prepared By : Asst. Prof Sanjivan Satyal
• When talking about network security, the CIA triad is one of the most
important models which is designed to guide policies for information
security within an organization.
CIA stands for:
• Confidentiality
• Integrity
• Availability
The next thing to talk about is integrity. Well, the idea here is to make sure that
data has not been modified. Corruption of data is a failure to maintain data
integrity. To check if our data has been modified or not, we make use of a hash
function.
We have two common types: SHA (Secure Hash Algorithm) and MD5 (Message
Direct 5). Now MD5 is a 128-bit hash and SHA is a 160-bit hash if we’re using
SHA-1. There are also other SHA methods that we could use like SHA-0, SHA-2,
and SHA-3.
Let’s assume Host ‘A’ wants to send data to Host ‘B’ to maintain integrity. A hash
function will run over the data and produce an arbitrary hash value H1 which is
then attached to the data. When Host ‘B’ receives the packet, it runs the same hash
function over the data which gives a hash value of H2. Now, if H1 = H2, this
means that the data’s integrity has been maintained and the contents were not
modified.
This means that the network should be readily available to its users.
This applies to systems and to data. To ensure availability, the
network administrator should maintain hardware, make regular
upgrades, have a plan for fail-over, and prevent bottlenecks in a
network.
Attacks such as DoS or DDoS may render a network unavailable as
the resources of the network get exhausted. The impact may be
significant to the companies and users who rely on the network as a
business tool.
Thus, proper measures should be taken to prevent such attacks.
Worms – Worms are also self-replicating in nature but they don’t hook themselves to the
program on host computer. Biggest difference between virus and worms is that worms are
network-aware. They can easily travel from one computer to another if network is available
and on the target machine they will not do much harm, they will, for example, consume hard
disk space thus slowing down the computer.
Trojan – The Concept of Trojan is completely different from the viruses and worms. The
name Trojan is derived from the ‘Trojan Horse’ tale in Greek mythology, which explains how
the Greeks were able to enter the fortified city of Troy by hiding their soldiers in a big wooden
horse given to the Trojans as a gift. The Trojans were very fond of horses and trusted the gift
blindly. In the night, the soldiers emerged and attacked the city from the inside.
Bots –: can be seen as advanced form of worms. They are automated processes that are
designed to interact over the internet without the need for human interaction. They can be
good or bad. Malicious bot can infect one host and after infecting will create connection to the
central server which will provide commands to all infected hosts attached to that network14
Asst. Prof. Sanjivan Satyal
called Botnet.
Malware on the basis of Actions:
• Adware – Adware is not exactly malicious but they do breach privacy of the users. They display
ads on a computer’s desktop or inside individual programs. They come attached with free-to-use
software, thus main source of revenue for such developers. They monitor your interests and
display relevant ads. An attacker can embed malicious code inside the software and adware can
monitor your system activities and can even compromise your machine.
• Spyware – It is a program or we can say software that monitors your activities on computer and
reveal collected information to an interested party. Spyware are generally dropped by Trojans,
viruses or worms. Once dropped they install themselves and sits silently to avoid detection.
• Ransom-ware – It is type of malware that will either encrypt your files or will lock your computer
making it inaccessible either partially or wholly. Then a screen will be displayed asking for money
i.e. ransom in exchange.
• Scare-ware – It masquerades as a tool to help fix your system but when the software is executed
it will infect your system or completely destroy it. The software will display a message to frighten
you and force to take some action like pay them to fix your system.
• Rootkits – are designed to gain root access or we can say administrative privileges in the user
system. Once gained the root access, the exploiter can do anything from stealing private files to
private data.
• Zombies – They work similar to Spyware. Infection mechanism is same but they don’t spy and
steal information rather they wait for theAsst.
command from hackers.
Prof. Sanjivan Satyal 15
8.2 Principles of Cryptography
• Cryptography is a method of using advanced mathematical principles in storing and transmitting
data in a particular form so that only those whom it is intended can read and process it.
1. Plaintext: The original message or data that is fed into the algorithm as input is called plaintext.
2. Encryption algorithm :The encryption algorithm is the algorithm that performs various
substitutions and transformations on the plaintext. Encryption is the process of changing plaintext
into cipher text.
3. Ciphertext: Ciphertext is the encrypted form the message. It is the scrambled message produced
as output. It depends upon the plaintext and the key.
4. Decryption algorithm: The process of changing Ciphertext into plain text is known as decryption.
Decryption algorithm is essentially the encryption algorithm run in reverse. It takes the Ciphertext
and the key and produces the original plaintext.
5. Key: It also acts as input to the encryption algorithm. The exact substitutions and
transformations performed by the algorithm depend on the key. Thus a key is a number or a set of
number that the algorithm uses to perform encryption and decryption.
b. Asymmetric-Key Cryptography
In asymmetric or public-key cryptography, there are two keys: a private key and a public
key. The private key is kept by the receiver. The public key is announced to the public.
In public-key encryption/decryption, the public key that is used for encryption is different
from the private key that is used for decryption. The public key is available to the public,
and the private key is available only to an individual.
This is the simplest kind of encryption that involves only one secret key to cipher and
decipher information.
Symmetrical encryption is an old and best-known technique.
It uses a secret key that can either be a number, a word or a string of random letters.
It is a blended with the plain text of a message to change the content in a particular way.
The sender and the recipient should know the secret key that is used to encrypt and
decrypt all the messages. AES, DES, RC5, and RC6 are examples of symmetric
encryption.
The most widely used symmetric algorithm is AES-128, AES-192, and AES-256.
Asst. Prof. Sanjivan Satyal 18
Asymmetric Key
Asymmetrical encryption is also known as public key cryptography, which is a relatively new
method, compared to symmetric encryption.
Asymmetric encryption uses two keys to encrypt a plain text.
Secret keys are exchanged over the Internet or a large network.
It ensures that malicious persons do not misuse the keys.
AES Algorithm
• The more popular and widely adopted symmetric encryption algorithm likely to be
encountered nowadays is the Advanced Encryption Standard (AES). It is found at least six
time faster than triple DES(Data Encryption Standard).
• A replacement for DES was needed as its key size was too small. With increasing
computing power, it was considered vulnerable against exhaustive key search attack.
Triple DES was designed to overcome this drawback but it was found slow
• Symmetric key symmetric block cipher
• 128-bit data, 128/192/256-bit keys
• Stronger and faster than Triple-DES
• Provide full specification and design details
• Software implementable in C and Java
Here, we restrict to description of a typical round of AES encryption. Each round comprise of four
sub-processes. The first round process is depicted below −
• The 16 input bytes are substituted by looking up a fixed table (S-box) given in design. The result is in a matrix of four rows
and four columns.
Shiftrows
• Each of the four rows of the matrix is shifted to the left. Any entries that ‘fall off’ are re-inserted on the right side of row.
Shift is carried out as follows −
• First row is not shifted.
• Second row is shifted one (byte) position to the left.
• Third row is shifted two positions to the left.
• Fourth row is shifted three positions to the left.
• The result is a new matrix consisting of the same 16 bytes but shifted with respect to each other.
MixColumns
• Each column of four bytes is now transformed using a special mathematical function. This function takes as input the four
bytes of one column and outputs four completely new bytes, which replace the original column. The result is another new
matrix consisting of 16 new bytes. It should be noted that this step is not performed in the last round.
Algorithm
• The integers used by this method are sufficiently large making it difficult to
solve.
• There are two sets of keys in this algorithm: private key and public key.
Digital signature is a cryptographic value that is calculated from the data and
a secret key known only by the signer
• Verifier also runs same hash function on received data to generate hash value.
• For verification, this hash value and output of verification algorithm are
compared. Based on the comparison result, verifier decides whether the digital
signature is valid.
• Since digital signature is created by ‘private’ key of signer and no one else can
have this key; the signer cannot repudiate signing the data in future.
NOTE: A hash function is a function that takes a set of inputs of any arbitrary size
and fits them into a table or other data structure that contains fixed-size
elements Asst. Prof. Sanjivan Satyal 35
Importance of Digital Signature
Message authentication − When the verifier validates the digital signature using public
key of a sender, he is assured that signature has been created only by sender who
possess the corresponding secret private key and no one else.
Data Integrity − In case an attacker has access to the data and modifies it, the digital
signature verification at receiver end fails. The hash of modified data and the output
provided by the verification algorithm will not match. Hence, receiver can safely deny the
message assuming that data integrity has been breached.
Non-repudiation − Since it is assumed that only the signer has the knowledge of the
signature key, he can only create unique signature on a given data. Thus the receiver can
present data and the digital signature to a third party as evidence if any dispute arises in
the future.
• The receiver receives the combination of encrypted secret key and message digest is
received.
• The encrypted secret key is decrypted by using the receiver's private key to get the one-
time secret key.
• The secret key is then used to decrypt the combination of message and digest.
• The digest is decrypted by using the sender's public key, and the original message is
hashed by using a hash function to create a digest.
• Both the digests are compared if both of them are equal means that all the aspects of
security are preserved.
• The Administration is difficult: The different versions of PGP complicate the administration.
• Compatibility issues: Both the sender and the receiver must have compatible versions of PGP. For
example, if you encrypt an email by using PGP with one of the encryption technique, the receiver
has a different version of PGP which cannot read the data.
• Complexity: PGP is a complex technique. Other security schemes use symmetric encryption that
uses one key or asymmetric encryption that uses two different keys. PGP uses a hybrid approach
that implements symmetric encryption with two keys. PGP is more complex, and it is less familiar
than the traditional symmetric or asymmetric methods.
• No Recovery: Computer administrators face the problems of losing their passwords. In such
situations, an administrator should use a special program to retrieve passwords. For example, a
technician has physical access to a PC which can be used to retrieve a password. However, PGP
does not offer such a special program for recovery; encryption methods are very strong so, it does
not retrieve the forgotten passwords results in lost messages or lost files.
• Transport Layer Securities (TLS) are designed to provide security at the transport layer. TLS was derived from
a security protocol called Secure Socket Layer (SSL). TLS ensures that no third party may eavesdrop or
tampers with any message.
• There are several benefits of TLS:
• Encryption:
TLS/SSL can help to secure transmitted data using encryption.
• Interoperability:
TLS/SSL works with most web browsers, including Microsoft Internet Explorer and on most operating
systems and web servers.
• Algorithm flexibility:
TLS/SSL provides operations for authentication mechanism, encryption algorithms and hashing
algorithm that are used during the secure session.
• Ease of Deployment:
Many applications TLS/SSL temporarily on a windows server 2003 operating systems.
• Ease of Use:
Because we implement TLS/SSL beneath the application layer, most of its operations are completely
invisible to client.
• SSL stands for Secure Socket Layer while TLS stands for Transport Layer
Security.
• Both Secure Socket Layer and Transport Layer Security are the protocols used to
provide security between web browsers and web servers.
• The main difference between Secure Socket Layer and Transport Layer Security is
that, in SSL (Secure Socket Layer), the Message digest is used to create a master
secret and It provides the basic security services which
are Authentication and confidentiality.
• while In TLS (Transport Layer Security), a Pseudo-random function is used to create
a master secret.
• TLS is highly reliable and upgraded. It provides less latency than SSL
• TLS (Transport Layer Security) provides high security thank SSL
•Firewalls cannot stop users from accessing malicious websites, making it vulnerable to internal threats or
attacks.
•Firewalls cannot protect against the transfer of virus-infected files or software.
•Firewalls cannot prevent misuse of passwords.
•Firewalls cannot protect if security rules are misconfigured.
•Firewalls cannot protect against non-technical security risks, such as social engineering.
•Firewalls cannot stop or prevent attackers with modems from dialing in to or out of the internal network.
•Firewalls cannot secure the system which is already infected.
• It analyses traffic at the transport protocol layer (but mainly uses first 3
layers). Packet firewalls treat each packet in isolation.
• Packet filtering firewall maintains a filtering table that decides whether the
packet will be forwarded or discarded. From the given filtering table, the
packets will be filtered according to the following rules: