Network Security
Network Security
NETWORK SECURITY
Key Management:
In cryptography, it is a very tedious task to distribute the public and private keys
between sender and receiver.
Key managements includes the use of a key-distribution center (KDC), certification
authorities (CAs), and public-key infrastructure (PKI).
1. Key-Distribution Center: KDC (previous unit)
2. Certification Authority : CA
3. Public-Key Infrastructures (PKI)
Certification Authority : CA
Bob wants two things; he wants people to know his public key, and he wants no one to
accept a forged(duplicate) public key as his. Bob can go to a certification authority
(CA), a federal or state organization that binds a public key to an entity and issues a
certificate. The CA has a well-known public key itself that cannot be forged. The CA
checks Bob’s identification (using a picture ID along with other proof). It then asks for
Bob’s public key and writes it on the certificate.
To prevent the certificate itself from being forged, the CA signs the certificate with its
private key. Now Bob can upload the signed certificate. Anyone who wants Bob’s
public key downloads the signed certificate and uses the center’s public key to extract
Bob’s public key.
X.509
Although the use of a CA has solved the problem of public-key fraud, it has created a
side-effect. Each certificate may have a different format. If Alice wants to use a
program to automatically download different certificates and digests belonging to
different people, the program may not be able to do this. One certificate may have the
public key in one format and another in a different format. The public key may be on
the first line in one certificate, and on the third line in another. Anything that needs to
be used universally must have a universal format.
To remove this side effect, the ITU has designed X.509, a recommendation that has
been accepted by the Internet with some changes. X.509 is a way to describe the
certificate in a structured way. It uses a well-known protocol called ASN.1 (Abstract
Syntax Notation 1) that defines fields familiar to C programmers.
1
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
2
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
❏ Extensions. This optional field allows issuers to add more private information to
the certificate.
❏ Signature. This field is made of three sections. The first section contains all other
fields in the certificate. The second section contains the digest of the first section
encrypted with the CA’s public key. The third section contains the algorithm identifier
used to create the second section.
Duties
Several duties have been defined for a PKI. The most important ones are shown in
fig:
3
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
❏ Certificates’ issuing, renewal, and revocation. These are duties defined in the
X.509. Because the PKIX is based on X.509, it needs to handle all duties related to
certificates.
❏ Keys’ storage and update. A PKI should be a storage place for private keys of those
members that need to hold their private keys somewhere safe. In addition, a PKI is
responsible for updating these keys on members’ demands.
❏ Providing services to other protocols. Some Internet security protocols, such as
IPSec and TLS, are relying on the services by a PKI.
❏ Providing access control. A PKI can provide different levels of access to the
information stored in its database. For example, an organization PKI may provide
access to the whole database for the top management, but limited access for
employees.
4
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
○ PGP stands for Pretty Good Privacy (PGP) which was invented by Phil
Zimmermann.
○ PGP was designed to provide all four aspects of security, i.e., privacy,
○ PGP is an open source and freely available software package for email
security.
At Sender site:
At Receiver Site:
5
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
○ PGP combines some of the best features of both conventional and public
○ PGP then creates a session key, which is a one-time-only secret key. This
6
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
IPSec can be useful in several areas. First, it can enhance the security of
those client/server programs, such as electronic mail, that use their own
security protocols. Second, it can enhance the security of those client/
server programs, such as HTTP, that use the security services provided at
the transport layer. It can provide security for those client/server
programs that do not use the security services provided at the transport
layer. It can provide security for node-to-node communication programs
such as routing protocols.
7
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
TWO MODES
Transport Mode
Tunnel Mode
8
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
The new IP header, as we will see shortly, has different information than
the original IP header. Tunnel mode is normally used between two
routers, between a host and a router, or between a router and a host, In
other words, tunnel mode is used when either the sender or the receiver is
not a host. The entire original packet is protected from intrusion between
the sender and the receiver, as if the whole packet goes through an
imaginary tunnel.
9
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
❏ Next header. The 8-bit next header field defines the type of payload
carried by the IP datagram (such as TCP, UDP, ICMP, or OSPF). It has
the same function as the protocol field in the IP header before
encapsulation. In other words, the process copies the value of the protocol
field in the IP datagram to this field. The value of the protocol field in the
new IP datagram is now set to 51 to show that the packet carries an
authentication header.
❏ Payload length. The name of this 8-bit field is misleading. It does not
define the length of the payload; it defines the length of the authentication
header in 4-byte multiples, but it does not include the first 8 bytes.
10
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
The AH protocol does not provide privacy, only source authentication and
data integrity. IPSec later defined an alternative protocol, Encapsulating
Security Payload (ESP), that provides source authentication, integrity, and
privacy. ESP adds a header and trailer.
11
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
❏ Pad length. The 8-bit pad-length field defines the number of padding bytes.
The value is between 0 and 255; the maximum value is rare.
❏ Next header. The 8-bit next-header field is similar to that defined in the AH
protocol. It serves the same purpose as the protocol field in the IP header before
encapsulation.
12
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
13
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
● The Record Protocol is the carrier. It carries messages from three other protocols as
well as the data coming from the application layer. Messages from the Record
Protocol are payloads to the transport layer, normally TCP.
● TCP. The Handshake Protocol provides security parameters for the Record Protocol. It
establishes a cipher set and provides keys and security parameters. It also
authenticates the server to the client and the client to the server if needed.
● The ChangeCipherSpec Protocol is used for signalling the readiness of cryptographic
secrets.
● The Alert Protocol is used to report abnormal conditions.
i. Handshake Protocol
The Handshake Protocol uses messages to negotiate the cipher suite, to authenticate the
server to the client and the client to the server if needed, and to exchange information for
building the cryptographic secrets. The handshaking is done in four phases, as shown in
Figure:
14
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
ClientHello The client sends the ClientHello message. It contains the following:
a. The highest SSL version number the client can support.
b. A 32-byte random number (from the client) that will be used for master secret generation.
c. A session ID that defines the session.
d. A cipher suite that defines the list of algorithms that the client can support.
e. A list of compression methods that the client can support.
In phase II, the server authenticates itself if needed. The sender may send its certificate,its
public key, and may also request certificates from the client. At the end, the server
announces that the serverHello process is done.
Phase III is designed to authenticate the client. Up to three messages can be sent from the
client to the server.
a. Certificate To certify itself to the server, the client sends a Certificate message.
15
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
b. ClientKeyExchange After sending the Certificate message, the client sends a Client-
KeyExchange message, which includes its contribution to the pre-master secret. The
contents of this message are based on the key-exchange algorithm used.
c. CertificateVerify If the client has sent a certificate declaring that it owns the public
key in the certificate, it needs to prove that it knows the corresponding private key.
This is needed to thwart an impostor who sends the certificate and claims that it
comes from the client. The proof of private-key possession is done by creating a
message and signing it with the private key. The server can verify the message with
the public key already sent to ensure that the certificate actually belongs to the
client.
In Phase IV, the client and server send messages to change cipher specification and
to finish the handshaking protocol. Four messages are exchanged in this phase,
Finished The next message is also sent by the client. It is a Finished message that
announces the end of the handshaking protocol by the client.
Finished Finally, the server sends a Finished message to show that handshaking is
totally completed.
16
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
The ChangeCipherSpec Protocol defines the process of moving values between the
pending and active states.
This protocol uses the SSL record protocol. Unless Handshake Protocol is completed, the SSL
record Output will be in a pending state. After the handshake protocol, the Pending state is
converted into the current state.
Change-cipher protocol consists of a single message which is 1 byte in length and can have
only one value. This protocol’s purpose is to cause the pending state to be copied into the
current state
SSL uses the Alert Protocol for reporting errors and abnormal conditions. It has only
one message type, the Alert message, that describes the problem and its level
(warning or fatal).
17
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
The Record Protocol carries messages from the upper layer (Handshake Protocol,
ChangeCipherSpec Protocol, Alert Protocol, or application layer). The message is
fragmented and optionally compressed; a MAC is added to the compressed message
using the negotiated hash algorithm. The compressed fragment and the MAC are
encrypted using the negotiated encryption algorithm. Finally, the SSL header is
added to the encrypted message. The process at the receiver is reversed.
18
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
● It analyzes the data flowing through the network to look for patterns and signs
of abnormal behavior.
● The IDS compares the network activity to a set of predefined rules and patterns
to identify any activity that might indicate an attack or intrusion.
● If the IDS detects something that matches one of these rules or patterns, it
sends an alert to the system administrator.
● The system administrator can then investigate the alert and take action to
prevent any damage or further intrusion.
19
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
20
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
i)Rule-based Detection:
Rule-based techniques detect intrusion by observing events in the system and applying
a set of rules that lead to a decision regarding whether a given pattern of activity is or
is not suspicious. Can characterize approaches as either anomaly detection or
penetration identification, although there is overlap. Rule-based anomaly detection is
similar in terms of its approach and strengths to statistical anomaly detection.
Rule-based penetration identification takes a very different approach based on expert
system technology. It uses rules for identifying known penetrations or penetrations
that would exploit known weaknesses, or identify suspicious behavior. The rules used
are specific to the machine and operating system. The rules are generated by
“experts”, from interviews of system administrators and security analysts. Thus the
strength of the approach depends on the skill of those involved in setting up the rules.
It is an intrusion detection system for detecting both network and computer intrusions
and misuse by monitoring system activity and classifying it as either normal or
anomalous. The classification is based on heuristics or rules, rather than patterns or
signatures, and attempts to detect any type of misuse that falls out of normal system
operation. This is as opposed to signature-based systems, which can only detect
attacks for which a signature has previously been created.
21
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
Intrusion Prevention:
The IPS is placed inline, directly in the flow of network traffic between the source and
destination. This is what differentiates IPS from its predecessor, the intrusion
detection system (IDS). Conversely, IDS is a passive system that scans traffic and
reports back on threats.
There are several types of IPS solutions, which can be deployed for different purposes.
These include:
strategic points to monitor all network traffic and scan for threats.
and looks at inbound/outbound traffic from that machine only. Often combined
22
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
Firewalls:
Firewalls prevent unauthorized access to networks through software or firmware. By
utilizing a set of rules, the firewall examines and blocks incoming and outgoing
traffic.
Fencing your property protects your house and keeps trespassers at bay; similarly,
firewalls are used to secure a computer network. Firewalls are network security
systems that prevent unauthorized access to a network.
It can be a hardware or software unit that filters the incoming and outgoing traffic
within a private network, according to a set of rules to spot and prevent cyberattacks.
Firewalls are used in enterprise and personal settings. They are a vital component of
network security.
Most operating systems have a basic built-in firewall. However, using a third-party
firewall application provides better protection.
Firewalls are designed with modern security techniques that are used in a wide range
of applications.
In the early days of the internet, networks needed to be built with new security
techniques, especially in the client-server model, a central architecture of modern
computing.
That's where firewalls have started to build the security for networks with varying
complexities. Firewalls are known to inspect traffic and mitigate threats to the devices.
Functions of Firewall
23
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
i. All traffic from inside to outside and vice versa must pass through the firewall. This
is achieved by physically blocking all access to the local network except via the
firewall. The configurations used for this are screened Host Firewall (Single and Dual)
and Screened Subnet Firewall.
ii. Only authorized traffic as defined by the local security policy will be allowed to
pass. Various types of firewalls that can be used are Packet-Filters, Stateful Filters and
Application Proxy Filters.
iii. The firewall itself is immune to penetration. This implies that use of a trusted
system with a secure operating system.
Types of Firewall:
24
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
Packet filtering firewalls are fast, cheap, and effective. But the security they provide is
very basic. Since these firewalls cannot examine the content of the data packets, they
are incapable of protecting against malicious data packets coming from trusted source
IPs. Being stateless, they are also vulnerable to source routing attacks and tiny
fragment attacks. But despite their minimal functionality, packet filtering firewalls
paved the way for modern firewalls that offer stronger and deeper security.
2. Circuit-Level Gateways
Working at the session layer, circuit-level gateways verify established Transmission
Control Protocol (TCP) connections and keep track of the active sessions. They are
quite similar to packet filtering firewalls in that they perform a single check and utilize
minimal resources. However, they function at a higher layer of the Open Systems
Interconnection (OSI) model. Primarily, they determine the security of an established
connection. When an internal device initiates a connection with a remote host,
circuit-level gateways establish a virtual connection on behalf of the internal device to
keep the identity and IP address of the internal user hidden.
Stateful inspection firewalls check for legitimate connections and source and
destination IPs to determine which data packets can pass through. Although these
extra checks provide advanced security, they consume a lot of system resources and
can slow down traffic considerably. Hence, they are prone to DDoS (distributed
denial-of-service attacks).
25
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
Unlike packet filtering firewalls, proxy firewalls perform stateful and deep packet
inspection to analyze the context and content of data packets against a set of
user-defined rules. Based on the outcome, they either permit or discard a packet. They
protect the identity and location of your sensitive resources by preventing a direct
connection between internal systems and external networks. However, configuring
them to achieve optimal network protection can be tricky. You must also keep in mind
the tradeoff—a proxy firewall is essentially an extra barrier between the host and the
client, causing considerable slowdowns.
Password Management:
Since passwords are meant to keep the files and data secret and safe so it is prevented
the unauthorized access, password management refers to the practices and set of rules
or principles or standards that out must follow or at least try to seek help from in order
to be a good/strong password and along with its storage and management for the
future requirements.
There are a lot of good practices that we can follow to generate a strong password and
also the ways to manage them.
● Strong and long passwords: A minimum length of 8 to 12 characters long,
also it should contain at least three different character sets (e.g., uppercase
characters, lowercase characters, numbers, or symbols)
26
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
Viruses
A virus can do anything that other programs do. The only difference is that it
attaches itself to another program and executes secretly when the host program
is run. Once a virus is executing, it can perform any function, such as erasing
files and programs.
During its lifetime, a typical virus goes through the following four phases:
27
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
Dormant phase: The virus is idle. The virus will eventually be activated by
some event, such as a date, the presence of another program or file, or the
capacity of the disk exceeding some limit. Not all viruses have this stage.
Propagation phase: The virus places an identical copy of itself into other
programs or into certain system areas on the disk. Each infected program will
now contain a clone of the virus, which will itself enter a propagation phase.
Triggering phase: The virus is activated to perform the function for which it
was intended. As with the dormant phase, the triggering phase can be caused by
a variety of system events, including a count of the number of times that this
copy of the virus has made copies of itself.
28
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
extension of a private network that is done with the use of VPN technology can
be used to access other private networks remotely through the use of a VPN
tunnel. A tunnel in networking is a way to send data that is not normally
supported by a network protocol by repackaging data in a packet to another
protocol. If two routers have tunneling configured it is possible to encapsulate
the data to send directly to each other over the Internet and then decapsulate the
payload that was sent through the tunnel to send it onwards to the destination.
fig: a
29
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
Fig: b
Web security
Web security threats are constantly emerging and evolving, but many threats
consistently appear at the top of the list of web security threats. These include:
30
Prof. Andleeb Sahar
UNIT V CRYPTOGRAPHY & NETWORK SECURITY
31
Prof. Andleeb Sahar