Computer Network Security Complete Notes
Computer Network Security Complete Notes
CTH EDUCATION
Computer Network Security
Questions to be discussed:
1. What is computer security?
2. Explain need of information security.
3. Discuss different types of attacks.
4. What is cryptography? Explain types of cryptography.
5. Differentiate between substitution and transposition cipher techniques.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
2
CTH EDUCATION
What is Computer Security?
Computer security is the protection of computer systems and information from harm, theft, and
unauthorized use.
It is the process of preventing and detecting unauthorized use of your computer system.
Computer security is also called cyber security, digital security or IT security.
August Kerckhoffs is known as the father of computer security.
Cyber Security:
It is defined as protecting computer systems, which communicate over the computer networks
Cyber attacks are those attacks that happen when our system is connected to the Internet.
Information Security:
Information security is securing information from unauthorized access, modification & deletion
It has mainly three objectives: confidentiality, integrity, and availability of information(CIA).
Application Security:
Application security means securing our applications and data so that they don’t get hacked and also
the databases of the applications remain safe and private to the owner itself so that user’s data
remains confidential.
Network Security:
Network Security is by securing both the software and hardware technologies.
Network security means securing a network and protecting the user’s information about who is
connected through that network.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
3
CTH EDUCATION
Need of information security:
It is essential for protecting sensitive and valuable data from unauthorized access.
The need of information security is essential because:
1. Protecting Confidential Information.
2. Maintaining Business Continuity.
3. Protecting Customer Trust.
4. Preventing Cyber-attacks.
5. Protecting Employee Information.
Backdoor:
In a backdoor attack, malware, trojan horse or virus gets installed in our system and start affecting
it’s security along with the main file.
Eavesdropping:
Eavesdropping refers to secretly listening to someone’s talk without their permission or knowledge.
Attackers try to steal, manipulate, modify, hack information or systems by passively listening to
network communication, knowing passwords etc.
Phishing:
Similarly, in phishing, a user is tricked by the attacker who gains the trust of the user or acts as if he is
a genuine person and then steals the information by ditching.
Not only attackers but some certain websites that seem to be genuine, but actually they are fraud
sites.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
4
CTH EDUCATION
Spoofing:
Spoofing is the act of masquerading as a valid entity through falsification of data(such as an IP
address or username), in order to gain access to information or resources that one is otherwise
unauthorized to obtain.
Spoofing is of several types- email spoofing, IP address spoofing, biometric spoofing etc.
Malware:
Malware is made up of two terms: Malicious + Software = Malware.
Malware intrudes into the system and is designed to damage our computers.
Different types of malware are adware, spyware, ransomware, Trojan horse, etc.
Social engineering:
Social engineering attack involves manipulating users psychologically and extracting confidential or
sensitive data from them by gaining their trust.
Polymorphic Attacks:
Poly means “many” and morph means “form”, polymorphic attacks are those in which attacker adopts
multiple forms and changes them so that they are not recognized easily.
These kinds of attacks are difficult to detect due to their changing forms.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
5
CTH EDUCATION
Cryptography:
It is a technique of sending information from sender to receiver using codes.
It securing information through use of codes so that only intended person can understand & process it.
Cryptography is used to preventing unauthorized access of information.
The prefix “crypt” means “hidden” and suffix “graphy” means “writing”.
Claude E. Shannon is considered to be the father of mathematical cryptography.
Key:
In cryptography, a key is a string of characters used within an encryption algorithm for altering data so
that it appears random.
Like a physical key, it locks (encrypts) data so that only someone with the right key can unlock (decrypt)
it.
Types of Cryptography:
In general there are three types Of cryptography:
1. Symmetric Key Cryptography:
2. Asymmetric Key Cryptography:
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
6
CTH EDUCATION
Asymmetric Key Cryptography:
Under this system a pair of keys is used to encrypt and decrypt information.
A receiver’s public key is used for encryption and a receiver’s private key is used for decryption.
Public key and Private Key are different.
Even if the public key is known by everyone the intended receiver can only decode it because he alone
know his private key.
The most popular asymmetric key cryptography algorithm is
RSA algorithm.
What is encryption?
In cryptography, encryption is the process of encoding information.
This process converts the original representation of the information, known as plaintext, into an
alternative form known as ciphertext.
Ideally, only authorized parties can decipher a ciphertext back to plaintext and access the original
information.
Substitution and transposition ciphers are two common types of symmetric encryption, which means
that the same key is used to encrypt and decrypt the message.
They are often used in combination to increase the security of the communication.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
7
CTH EDUCATION
Substitution cipher:
A substitution cipher replaces each letter or symbol in the plaintext with another one, according to a
fixed rule or a key.
The key is the number of shifts, and it can be changed periodically to avoid repetition.
Substitution ciphers are easy to implement and understand.
But in this an attacker can guess the key by looking at the most common patterns in the ciphertext.
Transposition cipher:
A transposition cipher rearranges the order of the letters or symbols in the plaintext, according to a
certain pattern.
Transposition ciphers are more difficult to break than substitution ciphers, but they can still be
attacked, which means that an attacker can try to find words or phrases that fit the ciphertext.
In substitution Cipher Technique, plain text In transposition Cipher Technique, plain text
characters are replaced with other characters, characters are rearranged with respect to the
numbers and symbols. position.
Substitution Cipher’s forms are: Mono Transposition Cipher’s forms are: Key-less
alphabetic substitution cipher and poly transposition cipher and keyed transposition
alphabetic substitution cipher. cipher.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
1
CTH EDUCATION
Unit – 02: Mathematics of cryptography
DES Block ciphers modes and Feistel ciphers DES.
working of DES,
cracking des, problems on des.
2DES, 3DES, des design,
Side channel attacks,
Differential cryptanalysis.
Questions to be discussed:
1. Discuss the term DES. Write the applications of DES Algorithm.
2. Explain different DES Modes of Operation.
3. Differentiate between DES and AES algorithms.
4. Discuss about 2DES and 3DES in brief.
5. What is a side-channel attack?
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
2
CTH EDUCATION
Mathematics of cryptography:
Mathematics of cryptography means use of mathematical techniques to encode plain text with hash
functions and perform crypto-analysis to identify the original text from encrypted keys.
It only requires a single key for both encryption It requires two keys, a public key and a private
and decryption. key, one to encrypt and the other one to decrypt.
The size of cipher text is the same or smaller than The size of cipher text is the same or larger than
the original plain text. the original plain text.
The length of key used is 128 or 256 bits The length of key used is 2048 or higher
Examples: 3DES, AES, DES and RC4 Examples: Diffie-Hellman, ECC, DSA and RSA
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
3
CTH EDUCATION
Applications of DES Algorithm:
Some of the applications of the DES Algorithm.
1. It is used in random number generation
2. It is deployed when not-so-strong encryption is needed
3. It is used to develop a new form of DES, called Triple DES (using a 168-bit key formed using three keys)
ECB:
ECB stands for Electronic Codebook.
Each 64-bit block is encrypted and decrypted independently.
CBC:
CBC stands for Cipher Block Chaining.
Each 64-bit block depends on the previous one and uses an Initialization Vector (IV).
CFB:
CFB stands for Cipher Feedback.
The preceding ciphertext becomes the input for the encryption algorithm, producing pseudo random
output, which in turn is XORed with plaintext, building the next ciphertext unit
OFB:
OFB stands for Output Feedback.
Much like CFB, except that the encryption algorithm input is the output from the preceding DES.
Counter (CTR):
CTR stands for Counter.
Each plaintext block is XORed with an encrypted counter.
The counter is then incremented for each subsequent block
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
4
CTH EDUCATION
Difference between DES and AES algorithms:
DES AES
Used to encrypt plain text of 64-bit Used to encrypt plain text of 128-bit
It can be broken by brute force attacks To date, AES has not been attacked
Working of DES:
As we know that DES is a Symmetric Key Encryption technique.
So, it uses the same key to encrypt and decrypt a message.
Both the sender and the receiver must know and use the same private key.
Some key features affecting how DES works include the following:
Block cipher:
The Data Encryption Standard is a block cipher, meaning a cryptographic key and algorithm are applied
to a block of data simultaneously rather than one bit at a time.
To encrypt a plaintext message, DES groups it into 64-bit blocks.
Each block is enciphered using the secret key into a 64-bit cipher text by means of permutation and
substitution.
64-bit key:
DES uses a 64-bit key, but because eight of those bits are used for parity checks, the effective key length
is only 56 bits.
The encryption algorithm generates 16 different 48-bit sub keys, one for each of the 16 encryption rounds.
Sub keys are generated by selecting and permuting parts of the key as defined by the DES algorithm.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
5
CTH EDUCATION
Replacement and permutation.
The algorithm defines sequences of replacement and permutation that the cipher text undergoes during
the encryption process.
Backward compatibility.
DES also provides this capability in some instances.
Cracking DES:
In cryptography, the DES cracker is a machine built by the Electronic Frontier Foundation in 1998.
It is used to perform a brute force search to decrypt an encrypted message by trying every possible key.
The aim in doing this was to prove that the key size of DES was not sufficient to be secure.
It is also known as EFF DES cracker or "Deep Crack".
Detailed technical data of this machine, including block diagrams, circuit schematics have all been
published in the book Cracking DES.
Its public domain license allows everyone to freely copy, use, or modify its design.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
6
CTH EDUCATION
Double DES:
Double DES is an encryption technique which uses two instance of DES on same plain text.
In both instances it uses different keys to encrypt the plain text.
Both keys are required at the time of decryption.
The 64 bit plain text goes into first DES instance which then converted into a 64 bit middle text using
the first key and then it goes to second DES instance which gives 64 bit cipher text by using second key.
However double DES uses 112 bit key but gives security level of 2^56 not 2^112 and this is because of
meet-in-the middle attack which can be used to break through double DES.
Triple DES:
Triple DES is an encryption technique which uses three instance of DES on same plain text.
It uses there different types of key choosing technique in first all used keys are different and in second
two keys are same and one is different and in third all keys are same.
Triple DES is also vulnerable to meet-in-the middle attack because of which it give total security level
of 2^112 instead of using 168 bit of key.
The block collision attack can also be done because of short block size and using same key to encrypt
large size of text.
It is also vulnerable to sweet32 attack.
Differential Cryptanalysis:
It is used to find the “difference” between related plaintexts that are encrypted.
The plaintexts may differ by a few bits.
It is usually launched as an adaptive chosen plaintext attack: the attacker chooses the plaintext to be
encrypted (but does not know the key), and then encrypts related plaintexts.
The cryptanalyst then uses statistical analysis to search for signs of non-randomness in the cipher texts,
zeroing in on areas where the plaintexts differed.
Every bit of the related cipher texts should have a 50/50 chance of flipping: the cryptanalyst searches
for areas where this is not true.
Any such underlying order is a clue to recover the key.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
1
CTH EDUCATION
Unit – 03: Symmetric-Key Cryptography
Glosis field theory,
AES, overview of Rijndael comparison with others.
Symmetric ciphers,
Blowfish in practice,
RC4, RC5, RC6, IDEA, RSA
Questions to be discussed:
1. What do you mean by Glosis field theory explain with example?
2. Write the difference between AES and DES.
3. Differentiate between block cipher and stream cipher.
4. Explain RC4, RC5 and RC6 in brief.
5. Write short notes on:
a. Rijndael algorithm
b. Blowfish
c. IDEA
d. RSA
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
2
CTH EDUCATION
Symmetric-Key Cryptography:
In cryptography Symmetric-key algorithms are algorithms that use the same cryptographic keys for
both the encryption of plaintext and the decryption of cipher text.
The keys may be identical, or there may be a simple transformation to go between the two keys.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
3
CTH EDUCATION
Difference between AES and DES:
AES DES
AES stands for Advanced Encryption Standard DES stands for Data Encryption Standard
Byte-Oriented. Bit-Oriented.
Key length can be 128-bits, 192-bits, and 256-bits The key length is 56 bits in DES.
AES can encrypt 128 bits of plaintext. DES can encrypt 64 bits of plaintext.
It can generate Ciphertext of 128, 192, 256 bits. It generates Ciphertext of 64 bits.
It is efficient with both hardware and software. It is efficient only with hardware.
Rijndael Algorithm:
It is a symmetric key algorithm.
Rijndael Algorithm also called Advance Encryption Standard(AES).
Rijndael is a family of Ciphers having distinctive keys and block sizes.
The algorithm changed into created by way of the cryptologists, Joan Daemen and Vincent Rijmen.
The word Rijndael was derived from their surnames.
It’s a block cipher that works iteratively.
Block size available in three different bit key versions that are 128-bit size, 192-bit size or 256-bit size.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
4
CTH EDUCATION
Symmetric ciphers:
Symmetric Encryption is the most basic and old method of encryption.
It uses only one key for the process of both the encryption and decryption of data.
Thus, it is also known as Single-Key Encryption.
A few basic terms in Cryptography are as follows:
Plain Text: original message to be communicated between sender and receiver
Cipher Text: encoded format of the original message that cannot be understood by humans
The Symmetric Cipher Model:
A symmetric cipher model is composed of five essential parts:
What is Blowfish?
Blowfish is a variable-length, symmetric, 64-bit block cipher.
Designed by Bruce Schneier in 1993 as a "general-purpose algorithm.
It was intended to provide a fast, free, drop-in alternative to the aging DES & IDEA.
Blowfish is significantly faster than DES and IDEA and is unpatented and available free for all uses.
However, it couldn't completely replace DES due to its small block size, which is considered insecure.
Blowfish features a 64-bit block size and takes a variable-length key, from 32 bits to 448 bits.
Blowfish uses a single encryption key to both encrypt and decrypt data.
What is cipher?
Ciphertext is encrypted text.
It is transformed from plaintext using an encryption algorithm.
Ciphertext can't be read until it has been converted into plaintext (decrypted) with a key.
The decryption cipher is an algorithm that transforms the ciphertext back into plaintext.
The term cipher is sometimes used as a synonym for ciphertext.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
5
CTH EDUCATION
Difference between block cipher and stream cipher:
Block Cipher is the kind of encryption that converts Stream cipher is the kind of encryption that
plaintext by taking each block individually. converts plaintext by taking one byte of the
plaintext at a time.
It uses both diffusion and confusion principles for the Only the confusion principle is used by Stream
conversion (used later in encryption). Cipher for the conversion.
In Block cipher, decryption is more difficult than In a stream cipher, XOR is used for encryption
stream cipher. that can quickly converted back to plain text.
Block Cipher uses both confusion and diffusion. Stream cipher relies on confusion only.
RC4:
RC4 stands for Rivest Cipher 4 or Ron’s Code 4.
RC4 is a form of stream cipher.
It encrypts messages one byte at a time.
RC4 is a variable key-size stream cipher with byte-oriented operations.
The RC4 cipher became the most widely used stream cypher due to its speed and simplicity.
It is used in common protocols such as Wired Equivalent Privacy(WEP), Secure Sockets Layer(SSL) and
Transport Layer Security (TLS).
RC5:
RC5 stands for "Rivest Cipher 5", or alternatively, "Ron's Code 5".
RC5 is a form of block cipher.
In cryptography, RC5 is a symmetric-key block cipher notable for its simplicity.
RC5 is a 32/64/128-bit block cipher developed in 1994.
It is notable for being simple, fast and consumes less memory.
RC5 is known for its fast encryption and decryption speeds.
It uses simple mathematical operations such as modular arithmetic and bit shifting, which can be
efficiently implemented on modern CPUs and hardware.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
6
CTH EDUCATION
RC6:
RC6 stands for "Rivest Cipher 6", or alternatively, "Ron's Code 6".
RC6 is a form of block cipher.
RC6 is a 128-bit block cipher based on RC5, was developed in 1997.
Its variable block size and key size make it highly adaptable to different applications or system.
RC6 encryption is widely used in various industries, including data protection, network security, and
digital rights management.
IDEA:
IDEA stands for International Data Encryption Algorithm
It is a symmetric-key block cipher that was first introduced in 1991.
IDEA is considered to be a good and secure algorithm.
IDEA uses a block cipher with a block size of 64 bits and a key size of 128 bits.
The cipher is designed to be highly secure and resistant to various types of attacks.
It was designed to provide secure encryption for digital data and is used in a variety of applications,
such as secure communications, financial transactions, and electronic voting systems.
RSA:
RSA is the most common public-key algorithm.
It was invented in 1978 by scientists Rivest, Shamir and Adleman.
RSA is a public-key encryption method used in data security.
This algorithm is safe and reliable for the transfer of data across the internet.
It takes care of the privacy of the data.
The process of implementing the RSA algorithm is quite simple.
RSA is safe and reliable for mechanisms, hence, there is no risk in sending private data.
Diploma : CSE (All Paper) By : Alok Sir (Mob. No.: +91-80 84 370 470)
1
CTH EDUCATION
Unit – 04: Asymmetric-Key Cryptography
RSA,
Elliptic curve cryptography ECC,
Digital certificates and PKI.
Questions to be discussed:
1. What is asymmetric cryptography? Discuss RSA in brief.
2. Discuss Elliptic curve cryptography in details.
3. What do you mean by Digital certificates and PKI.
AES RSA
Fast and efficient for bulk data Slower, not suited for large data
Secure file storage and communication Secure email and digital certificates
Server certificates:
These certificates identify a server (computer) and contain the host name or IP address.
They are used for one- or two-layer SSL to ensure secure communication of data over a network.
Encryption certificates:
These certificates are used to encrypt a message using the public key of the recipient to ensure data
confidentiality during transmission. Different signatures for encryption and digital signatures are
available from different CAs. (adapted from Government of India 2010)
Figure 13. Digital certificates
Questions to be discussed:
1. What are Cryptographic Hash Functions?
2. What is digital signature? What are the benefits of digital signatures?
3. Write the difference between RSA algorithm and DSA.
4. Write short notes on:
a. Message Digest(MD)
b. MAC
c. Kerberos.
Hash
Function
MAC = C (K, M), where K is a shared secret key and M is a message to be authenticated.
DSS:
DSS stands for Digital Signature Standard.
It was introduced by the National Institute of Standards and Technology (NIST) in 1994.
It was first proposed in 1991 and revised in 1993.
DSS used SHA to create digital signatures.
Kerberos:
Kerberos is a protocol that helps in network authentication.
It provides a centralized authentication server.
Its main function is to authenticate users to servers and servers to users.
In Kerberos Authentication server and database is used for client authentication.
Questions to be discussed:
1. What do you mean by network security? What are the benefits of network security?
2. What are network security protocol? Discuss any two network security protocol.
3. Discuss about email security. Also explain email architecture.
4. Differentiate between PGP and S/MIME.
5. What is IP Security? Define its architecture in brief.
6. Define Virtual Private Network in brief.
SSL:
SSL stands for secure socket layer.
It provides security to the data that is transferred between web browser and server.
SSL encrypts the link between a web server and a browser which ensures that all data passed between
them remain private and free from attack.
SSL Record provides two services to SSL connection:
1. Confidentiality
2. Message Integrity
TSP:
TSP stands for Time Stamp Protocol.
The TSP is a cryptographic protocol for certifying timestamps using X. 509 certificates and public key.
The TSP is the signer's assertion that a piece of electronic data existed at or before a particular time.
The protocol is defined in RFC 3161.
WAP Security:
WAP stands for Wireless Application Protocol.
It is a protocol that is introduced in 1999.
It offers Internet communications over wireless devices, such as mobile phones.
It offers a way of creating web applications for mobile devices, and it is designed for micro-browsers.
Email security:
It is the practice of protecting email accounts and communications from unauthorized access or loss.
Email security refers to the steps where we protect the email messages and the information.
It involves ensuring the confidentiality, integrity, and availability of email messages.
Organizations can enhance their email security using tools to protect against malicious threats such as
malware, spam, and phishing attacks.
S/MIME:
S/MIME stands for Secure/Multipurpose Internet Mail Extension.
S/MIME is a security-enhanced version of Multipurpose Internet Mail Extension (MIME).
In this, public key cryptography is used for digital sign, encrypt or decrypt the email.
User acquires a public-private key pair with a trusted authority and then makes appropriate use of
those keys with email applications.
PGP S/MIME
PGP is good for personal as well as office use. While it is good for industrial use.
PGP is less efficient than S/MIME. While it is more efficient than PGP.
IP security (IPSec):
IP Sec stands for Internet Protocol Security.
It is a standard suite of protocols between two communication points across the IP network.
It provides data authentication, integrity, and confidentiality.
It also defines the encrypted, decrypted, and authenticated packets.
The protocols needed for secure key exchange and key management are defined in it.
IP Security Architecture:
IP Security architecture uses two protocols to secure the traffic or data flow.
These protocols are ESP (Encapsulation Security Payload) and AH (Authentication Header).
Web Security:
Web security refers to protecting networks and computer systems from damage to or the theft of software,
hardware, or data.
It includes protecting computer systems from misdirecting or disrupting the services they are designed
to provide.
Questions to be discussed:
1. What do you mean by Intruder?
2. What is attack? Describe different types of attacks in network security.
3. Define the term virus. Explain various types of virus in brief.
4. Describe virus and antivirus in details.
5. Write short notes on:
a. Firewall
b. Virtual Private Network(VPN)
c. Honeypot
Unauthorized access
Unauthorized access refers to attackers accessing a network without receiving permission.
Insider threats
Insider threats are cybersecurity threats that originate with authorized users—employees, contractors,
business partners—who intentionally or accidentally misuse their legitimate access, or have their
accounts hijacked by cybercriminals.
Malware:
Malware stands for malicious software.
Malware is the name that is given to any type of software that could harm a computer system.
It interferes with and gather a user's data, or make the computer perform actions without the owner's
knowledge or permission.
Trojan horse:
A type of malware that uses malicious code to install software that seems ok, but is hidden to create
back doors into a system.
This typically causes loss or theft of data from an external source.
Spyware:
Spyware is software that aids in gathering information about a person or organization without their
knowledge.
Spyware can monitor and log the activity that is performed on a target system, like log key strokes, or
gather credit card and other information.
What is Anti-Virus?
Antivirus is a kind of software used to prevent, scan, detect and delete viruses from a computer.
Once installed, most antivirus software runs automatically in the background to provide real-time
protection against virus attacks.
Antivirus software helps protect your computer against malware and cybercriminals.
Antivirus software looks at data — web pages, files, software, applications — traveling over the network
to your devices.
It searches for known threats and monitors the behavior of all programs, flagging suspicious behavior.
It seeks to block or remove malware as quickly as possible