Network Security
Network Security
Security services are essential mechanisms used to protect data, networks, and systems from
unauthorized access, alteration, or destruction. These services ensure that the information
exchanged over networks remains secure, reliable, and available to authorized users.
1. Confidentiality
• Purpose: Prevents unauthorized access to sensitive data.
• Mechanisms:
• Encryption ensures that only authorized individuals with the correct decryption keys can read the
data.
• Access control mechanisms limit who can view the data.
• Example: Encrypting financial transactions in online banking to prevent eavesdropping by
hackers.
Integrity
•The process of converting ciphertext back into plaintext using a decryption key.
•Example: Converting "G5yT7" back into "Hello."
•Key: A secret value used by an encryption algorithm to convert plaintext to ciphertext and vice
versa. It could be a string of numbers, characters, or even a combination.
•Public Key: Used in public-key cryptography, this key is openly shared to encrypt data.
•Private Key: A confidential key used in public-key cryptography to decrypt the data encrypted
by the corresponding public key.
a. Cryptanalysis: The study and practice of breaking encryption methods to gain access to
the original plaintext without knowing the decryption key.
b. Work Factor: The estimated amount of time, effort, or computational resources required
to break a cryptographic system (e.g., decrypt ciphertext) using cryptanalysis. It indicates
the system's strength against attacks.
1.Confidentiality in symmetric key
cryptography
•Process: In symmetric key cryptography, the same key is used for both encryption
(converting plaintext into ciphertext) and decryption (converting ciphertext back into plaintext).
•Key Sharing: The key must be kept secret and shared between the sender and receiver. A
problem with symmetric cryptography is the challenge of securely sharing this key between the
two parties.
The sender encrypts a message (plaintext) using a shared secret key.
This produces a ciphertext which is transmitted through a network.
The receiver then uses the same shared secret key to decrypt the ciphertext back into
plaintext.
2. Asymmetric Key Cryptography
(also called Public Key
Cryptography):
•Process: Asymmetric cryptography uses two keys:
1.Public Key (known to everyone)
2.Private Key (known only to the owner)
•Each party has a public key for others to use and a private key for themselves.
•In this method, encryption is done using the receiver's public key and decryption is done using the
receiver's private key.
The sender encrypts the plaintext using the receiver's public key, producing ciphertext.
The ciphertext travels through the network.
The receiver decrypts it using their private key to retrieve the plaintext.
cryptography encryption model
•Ciphertext-Only Attack: The attacker only sees the scrambled message (ciphertext)
and tries to figure out the original message (plaintext) or the key.
•Known-Plaintext Attack: The attacker has both the scrambled message (ciphertext)
and part of the original message (plaintext). They use this to find the key or crack more
messages.
•Chosen-Plaintext Attack: The attacker can pick messages to encrypt and then sees the
scrambled version. They use this to discover patterns and break the encryption.
•Chosen-Ciphertext Attack: The attacker can pick scrambled messages (ciphertext) and
see the decrypted version. This helps them find weaknesses and potentially break the
encryption.
Types of encryption methods
1. Substitution Cipher:
A Substitution Cipher is a simple encryption technique where each letter of
the plaintext is replaced by another letter or symbol. The relationship
between the plaintext and ciphertext is one-to-one, meaning each character
in the plaintext has a unique substitute in the ciphertext.
In a monoalphabetic substitution cipher, one fixed substitution rule is applied to the entire message. Each letter in the
plaintext is replaced by the same corresponding letter or symbol in the ciphertext throughout the message.
Example:
Let’s use the following key for encryption:
• Plaintext Alphabet: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
• Cipher Alphabet: M N B V C X Z L K J H G F D S A Q W E R T Y U I O P
Now, encrypt the word CAT:
• C becomes B
• A becomes M
• T becomes Y
The ciphertext of CAT is BMY.
2. Polyalphabetic Substitution Cipher
A polyalphabetic substitution cipher uses multiple cipher alphabets to encrypt the message. Different parts of the plaintext are
encrypted with different substitution rules, which makes it harder for attackers to detect patterns.
Example: Vigenère Cipher
Let’s encrypt the word HELLO using the key KEY (repeated to match the length of the message: KEYKE).
1. Plaintext: H E L L O
2. Key: K E Y K E
Now, using a Caesar cipher shift based on each letter of the key:
• H (shifted by K, 10 positions) becomes R
• E (shifted by E, 4 positions) becomes I
• L (shifted by Y, 24 positions) becomes J
• L (shifted by K, 10 positions) becomes V
• O (shifted by E, 4 positions) becomes S
So, HELLO becomes RIJVS.
Ceasar Cipher
Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher:D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
ANS: "dwwdfn wrpruurz diwhu oxqfk"
Question.
Q. using ceasar cipher with key 123 to the message "attack tomorrow after lunch "
In a Caesar cipher, the key typically represents the number of positions each letter is shifted in the
alphabet. However, since the key you've provided is 123, which is larger than the number of letters
in the alphabet (26), you can simplify it by taking the modulus of the key with 26.
Calculation:
• 123mod 26=19 123 \mod 26 = 19 123mod26=19
So, a key of 123 is equivalent to a key of 19 in the context of a Caesar cipher.
Here's how it's calculated:
• Divide 123 by 26:
123÷26=4 with a remainder of 19.
• So, 123mod 26=19 123mod26=19.
Encrypting "attack tomorrow after lunch" with a shift
of 19:
1. Write down the alphabet:
Plain: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher: T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
"tmmtvd mffiiif tmev eleva“
-------------------------------------------------------------------------------
Transposition Cipher
• What the OTP does: The OTP is a number that you have to enter to log in, but it’s only valid for a few
minutes. This ensures that the login is fresh and recent, preventing someone from reusing an old OTP to
gain access to your account later.
• Why it helps: If someone intercepted your previous OTP, they couldn’t use it after it expired because it
was valid only for a short period (ensuring freshness). Each time you try to log in, a new OTP is
generated, preventing attackers from using old codes to break into your account.
In Cryptography:
Freshness ensures that each message or action is new and hasn’t been reused. It prevents attacks where
old, legitimate data is captured and resent to trick the system.
Example in cryptography: A nonce (number used once) is similar to an OTP in cryptographic
communications. It ensures that a message, even if intercepted, cannot be replayed or reused by an
attacker. Every secure transaction or message includes a new nonce, so each communication is
Communication security
Stateless: Packet-filtering firewalls are often called "stateless" firewalls because they do not keep
track of the state of connections.
A Stateful Firewall is a type of firewall that tracks and monitors the state of
network connections. This means it remembers the history of a connection,
like whether it’s just starting, already established, or closing. By doing this, it
can make smarter decisions about what traffic to allow or block.
A Stateful Firewall is like a smart security guard for your network.
In Short:
A stateful firewall is a smart guard that keeps track of who’s talking to whom,
making sure only the right information gets in!
Key Features:
An Application Gateway, often referred to as a Proxy Firewall, is a type of firewall that acts as an
intermediary between users and the applications or services they want to access.
Web Security refers to the practices and measures taken to protect websites and web
applications from various threats and attacks. It aims to safeguard the integrity,
confidentiality, and availability of web resources and user data.
Threats in web security: 1.
Spoofing
Definition: In this context, spoofing refers to an attacker creating a fake version of a
prominent website's homepage to deceive users into thinking they are visiting the
legitimate site.
Example:
Imagine a user types in the URL for their bank’s website (e.g., www.examplebank.com)
in their web browser. Instead of the real homepage, they are redirected to a fake
homepage that looks almost identical to the real one. This fake site may have:
• The same logo and color scheme as the legitimate bank.
• Similar content, including links to account login, services, and customer support.
• Fake testimonials or reviews to build credibility.
How It Works:
1.Phishing Email: An attacker sends a phishing email to potential victims, claiming there is
a security issue with their account. The email contains a link to the fake website.
2.Domain Spoofing: The attacker may use a domain name that closely resembles the real
one (e.g., www.exarnplebank.com instead of www.examplebank.com) to trick users.
3.Data Harvesting: When users enter their login credentials on the fake site, the attacker
captures this information and can then access the real bank account.
Impact:
•Loss of Sensitive Information: Users may unknowingly provide their usernames and
passwords, leading to unauthorized access to their accounts.
•Financial Loss: Victims could suffer financial losses if their accounts are accessed and
funds are withdrawn.
•Reputation Damage: The legitimate website could face reputational damage if users fall
victim to the spoofing attack.
2. Denial of Service
Impact:
•Website Crash: Legitimate customers can't access the website to shop, leading to
lost sales.
•Customer Frustration: People trying to buy items get frustrated when the site
doesn’t work, which can hurt the store's reputation.
•Financial Loss: The store loses money because customers can't make purchases
during the sale.
Malware
Malware, short for "malicious software," is any software specifically designed to disrupt,
damage, or gain unauthorized access to computer systems, networks, or devices. It can take
many forms and is often used by attackers to steal data, cause harm, or take control of systems.
Types of Malware
Viruses: Attaches itself to legitimate files or programs and spreads when those files are shared.
Worms: Self-replicating malware that spreads across networks without needing a host file.
Trojans: Malware disguised as legitimate software that, once installed, allows attackers access
to the system.
Spyware: Secretly monitors user activity and collects personal information without consent.
How Malware Spreads:
•Email Attachments: Many types of malware are spread through malicious email attachments
that users open.
•Infected Software: Downloading software or applications from untrustworthy sources can lead
to malware infections.
•Vulnerable Systems: Exploiting security vulnerabilities in operating systems and applications
allows malware to spread easily.
•Removable Media: USB drives and external hard drives can carry malware from one device to
another.
Hacking is the act of gaining unauthorized access to computer systems, networks, or devices,
often with the intent to steal, manipulate, or destroy data. While hacking can be used for malicious
purposes, it can also be conducted for ethical reasons, such as identifying security vulnerabilities.
Types of Hacking:
Black Hat Hacking: Malicious hacking done for personal gain or to cause harm. Black hat
hackers exploit vulnerabilities for illegal activities, such as data theft or system damage.
White Hat Hacking:Ethical hacking conducted to improve security. White hat hackers, often
referred to as ethical hackers, help organizations identify and fix vulnerabilities.
Phishing:A technique used by hackers to trick individuals into providing sensitive information,
such as usernames and passwords, often through deceptive emails or websites. Ex. An attacker
sends an email that appears to be from a bank, directing users to a fake login page to steal their
credentials.
Prevention and Protection:
What is Secure Naming? Secure naming is about ensuring that the names and identifiers we
use in digital systems (like websites and emails) are safe and trustworthy. It helps prevent
unauthorized access and impersonation by making sure that names are legitimate.
Why is Secure Naming Important?
1. Identity Verification: Confirms that users and services are who they claim to be, reducing
impersonation risks.
2. Data Integrity: Protects against tampering, ensuring that the information shared is accurate.
3. Building Trust: Helps users feel confident that they are interacting with legitimate entities
online.
4. Prevention of Attacks: Reduces the chances of cyber attacks like phishing and spoofing.
Examples of Secure Naming
Practices:
1. Using HTTPS: Websites should use HTTPS to encrypt data and verify the
server's identity, making it harder for attackers to intercept information.
2. Secure DNS Services: Use DNS services that support DNSSEC for added
protection against attacks that target DNS.
3. Certificate Pinning: Applications should only accept trusted certificates to
prevent attackers from intercepting communications.
4. Regular Audits: Organizations should regularly check their naming systems
and practices to ensure they are secure and up to date.
DNS Spoofing
DNS spoofing (or DNS cache poisoning) is a malicious attack that compromises the Domain
Name System (DNS), causing users to be directed to fraudulent websites instead of the
intended legitimate ones. This can lead to data theft, malware infections, and other security
issues.
Examples of DNS Spoofing Attacks:
1. Phishing Attacks:
1. An attacker may redirect a user from a legitimate banking website to a fake one designed to steal
login credentials.
2. Malware Distribution:
1. Users trying to access a popular software download site could be sent to a site that hosts malware,
leading to infection.
•Client: Represents the innocent user trying to access a
real website.
•Attacker: Exploits vulnerabilities in the DNS to mislead
users.
•DNS Server: The system that translates domain names
into IP addresses but is tricked into caching false
information.
•Fake Website: The attacker's site designed to capture
sensitive information from the user.
DNS Spoofing Process Explained:
Secure DNS refers to measures and protocols designed to enhance the security of the Domain Name
System (DNS), protecting it from various types of attacks like DNS spoofing, cache poisoning, and
other vulnerabilities
DNSSEC (Domain Name System Security Extensions) is designed to protect the integrity and
authenticity of DNS data.
Benefits of Secure DNS
• Protection Against Spoofing: Secure DNS helps prevent attackers from redirecting users to malicious
sites.
• Privacy: Encrypting DNS queries ensures that user browsing habits and requests are not exposed to
eavesdroppers.
• Data Integrity: Verifying DNS responses helps maintain the integrity of the data being accessed by
users.
Fundamental services offered by DNS
sec
1. Proof of Where Data Originated
• What It Is: DNSSEC provides assurance that the data received from a DNS query comes from a legitimate source.
• How It Works: When a DNS server responds to a query, it includes a digital signature that is generated using a private key. The
corresponding public key, which is published in the DNS records, can be used to verify that the response has not been altered and indeed
comes from the expected source.
2. Public Key Distribution
• What It Is: DNSSEC facilitates the distribution of public keys necessary for verifying DNS signatures.
• How It Works: Each zone (domain) has a public key that is securely distributed as part of its DNS records. When a resolver queries for a
domain, it can retrieve this public key and use it to verify the digital signatures associated with the DNS responses, ensuring data integrity.
3. Transaction and Request Authentication
• What It Is: DNSSEC helps authenticate both the requests made by clients and the transactions occurring between DNS servers.
• How It Works: By using signatures for responses and maintaining a chain of trust through key distribution, DNSSEC can authenticate that
requests and responses have not been tampered with during transmission. This ensures that the data exchanged is legitimate and reliable.
RRSets (Resource Record Sets)
RRSets (Resource Record Sets) are a key concept in DNS (Domain Name System). They are
groups of resource records with the same name, class, and type but potentially different data.
Each domain can have multiple resource records, and when grouped together based on their
type, they form an RRSet.
Example Scenario: DNS Records for google.com
Imagine you want to access the Google website. When you enter google.com in your browser,
your system queries the DNS server to resolve this domain name into an IP address. In response,
the DNS server provides a set of resource records that are grouped into RRSets based on the
type of information being provided. Here are some common types of records in an RRSet:
1. A Records (IPv4 Address): An A record maps the domain name to its IPv4 address. Google
uses multiple IP addresses for load balancing and redundancy, so multiple A records exist for
google.com.
Example of an RRSet for A records:
Here, all A records share the same name (google.com), class (IN), and
type (A), so they form an RRSet.
Self-certifying names
Self-certifying names are cryptographic names that verify their authenticity and
integrity without needing third-party authorities. They are generated from
cryptographic keys or hashes, making them secure and tamper-resistant.
Self-certifying names in network security refer to a naming system where each name is
associated with a public key that can be used to verify the identity of the owner or
entity associated with that name. This approach helps to improve security and trust in
network communications, especially in distributed systems.
When a user wants to communicate with a particular entity, they can use the self-
certifying name to retrieve the associated public key. They can then verify the identity
of the entity by checking a digital signature made using the corresponding private key.
+
Steganography