0% found this document useful (0 votes)
30 views84 pages

R20 20CS1001 - CRDS Question Bank With Answers

Uploaded by

jinopa9749
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views84 pages

R20 20CS1001 - CRDS Question Bank With Answers

Uploaded by

jinopa9749
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

SIDDHARTH INSTITUTE OF ENGINEERING & TECHNOLOGY:: PUTTUR

(AUTONOMOUS)
Siddharth Nagar, Narayanavanam Road – 517583

QUESTION BANK WITH ANSWERS (DESCRIPTIVE)

Subject with Code: Cryptography & Data Security (20CS1001)


Course & Branch: B.Tech – CIC
Regulation: R20
Year & Sem: II-B.Tech & II-Sem
UNIT-I INTRODUCTION TO SECURITY CONCEPTS
1. Explain in detail about passive attacks and active attacks. [L2][CO1] [12M]
Passive Attacks
Passive attacks are in the nature of eavesdropping on, or monitoring of, transmissions. The goal of
the opponent is to obtain information that is being transmitted.

Passive attacks are of two types:


Release of message contents: A telephone conversation, an e-mail message and a transferred file
may contain sensitive or confidential information.

Traffic analysis: If we had encryption protection in place, an opponent might still be able to
observe the pattern of the message. The opponent could determine the location and identity of
communication hosts and could observe the frequency and length of messages being exchanged.
This information might be useful in guessing the nature of communication that was taking place.
Passive attacks are very difficult to detect because they do not involve any alteration
of 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.
These attacks can be classified in to four categories:
Masquerade – One entity pretends to be a different entity.

Replay – involves passive capture of a data unit and its subsequent transmission to produce an
unauthorized effect.

Repudiation – This attack occurs when the network is not completely secured or the login control
has been tampered with. With this attack, the author‘s information can be changed by actions of a
malicious user in order to save false data in log files, similar to the spoofing of e-mail messages.
Modification of messages – Some portion of message is altered or the messages are delayed or
recorded, to produce an unauthorized effect.

Denial of service – Prevents or inhibits the normal use or management of communication facilities.
Another form of service denial is the disruption of an entire network, either by disabling the
network or overloading it with messages so as to degrade performance.

2. a. What is meant by security services? Explain various security services listed


in X.800? [L1][CO1] [6M]
Confidentiality: Ensures that the information in a computer system and transmitted
information are accessible only for reading by authorized parties.
E.g. Printing, displaying and other forms of disclosure.
Connection Confidentiality:The protection of all user data on a connection.
Connectionless Confidentiality: The protection of all user data in a single datablock
Selective-Field Confidentiality: The confidentiality of selected fields within the user data on a
connection or in a single data block.
Traffic Flow Confidentiality: The protection of the information that might be derived from
observation of traffic flows.
Authentication: Ensures that the origin of a message or electronic document is correctly
identified, with an assurance that the identity is not false.
Peer Entity Authentication: Used in association with a logical connection to provide confidence in
the identity of the entities connected.
Data Origin Authentication: In a connectionless transfer, provides assurance thatthe source of
received data is as claimed.
Integrity: Ensures that only authorized parties are able to modify computer system assets and
transmitted information. Modification includes writing, changing status, deleting, creating and
delaying or replaying of transmitted messages.
Connection Integrity with Recovery: Provides for the integrity of all user data ona connection
and detects any modification, insertion, deletion, or replay of any data within an entire data
sequence,with recovery attempted.
Connection Integrity without Recovery: As above, but provides only detectionwithout recovery.
Selective-Field Connectionless Integrity: Provides for the integrity of selected fields within a
single connectionless data block; takes the form of determination ofwhether the selected fields have
been modified.
Non repudiation: Requires that neither the sender nor the receiver of a message be able to deny
the transmission.
Nonrepudiation, Origin: Proof that the message was sent by the specified party.
Nonrepudiation, Destination: Proof that the message was received by the specified party.
Access control: Requires that access to information resources may be controlled by or the target
system.
Availability: Requires that computer system assets be available to authorized parties when
needed.

b. Differentiate Substitution and Transposition techniques. [L3[CO1][6M]

S.No Substitution Cipher Technique Transposition Cipher Technique

In substitution Cipher Technique, plain text In transposition Cipher Technique, plain text
1. characters are replaced with other characters, characters are rearrangedwith respect to the
numbers and symbols. position.
Substitution Cipher‘s forms are:Mono Transposition Cipher‘s forms are: Key-less
2. alphabetic substitution cipher and poly transposition cipher and keyed transposition
alphabetic substitution cipher. cipher.
In substitution Cipher Technique,character‘s While in transposition Cipher Technique, The
3. identity is changed while its position remains position of the character is changed but character‘s
unchanged. identity is not changed.
While in transposition Cipher Technique, The
In substitution Cipher Technique, The letter
4. Keys which are nearerto correct key can disclose
with low frequency candetect plain text.
plain text.
The example of substitution Cipheris Caesar The example of transposition Cipher isRail Fence
5.
Cipher. Cipher.
3. a. Examine the properties of Security Mechanisms. [L3][CO1] [8M]
Encryption or encryption-like transformations of information are the most common means
of providing security.

Types of Security Mechanism are:


1. Decipherment: This security mechanism deals with hiding and covering of data which helps
data to become confidential. It is achieved by applying mathematical calculations or
algorithms which reconstruct information into not readable form.
2. Access Control: This mechanism is used to stop unattended access to data which you are
sending. It can be achieved by various techniques such as applying passwords, using firewall,
or just by adding PIN to data.
3. Notarization: This security mechanism involves use of trusted third party in communication.
It acts as mediator between sender and receiver so that if any chance of conflict is reduced.
This mediator keeps record of requests made by sender to receiver for later denied.
4. Data Integrity: This security mechanism is used by appending value to data to which is
created by data itself. It is similar to sending packet of information known to both sending
and receiving parties and checked before and after data is received.
5. Authentication exchange: This security mechanism deals with identity to be known in
communication. This is achieved at the TCP/IP layer where two-way handshaking
mechanism is used to ensure data is sent or not
6. Bit stuffing: This security mechanism is used to add some extra bits into data which is being
transmitted. It helps data to be checked at the receiving end and is achieved by Even parity or
Odd Parity.
7. Digital Signature: This security mechanism is achieved by adding digital data that is not
visible to eyes. It is form of electronic signature which is added by sender which is checked
by receiver electronically.
8. Traffic Padding − The insertion of bits into gaps in an information flow is known as traffic
padding. This provide to counter traffic analysis attempts.
9. Routing Control − Routing control allows selection of specific physically secure routes for
specific data transmission and enablesrouting changes, particularly when a gap of security is
suspected.
b. Compare Encryption and Decryption Process. [L4][CO1] [4M]

S.NO ENCRYPTION DECRYPTION

Encryption is the process of converting


While decryption is the process of converting
1. normal message into meaningless
meaningless message into itsoriginal form.
message.
Encryption is the process While decryption is the process which
2.
which take place at sender‘s end. take place at receiver‘s end.
Its major task is to convert the plain While its main task is to convert the
3.
text into cipher text. cipher text into plain text.
Whereas the encrypted message can be
Any message can be encrypted with
4. decrypted with either secret key or
either secret key or public key.
private key.
In encryption process, sender sends Whereas in decryption process, receiver
5. the data to receiver after encrypted receives the information (Cipher text)
it. and convert into plain text.
The only single algorithm is used for
The same algorithm with the same
encryption-decryption with a pair of
6. key is used for the encryption-
keys where each use for encryption and
decryption process.
decryption.

4. a.Classify possible types of attacks in cryptography? [L2][CO1] [8M]


 Ciphertext Only Attacks (COA) − In this method, the attacker has access to a set of ciphertext(s).
He does not have access to corresponding plaintext. COA is said to be successful when the
corresponding plaintext can be determined from a given set of ciphertext. Occasionally, the
encryption key can be determined from this attack.
 Known Plaintext Attack (KPA) − In this method, the attacker knows the plaintext for some parts
of the ciphertext. The task is to decrypt the rest of the ciphertext using this information. This may be
done by determining the key or via some other method. The best example of this attack is linear
cryptanalysis against block ciphers.
 Chosen Plaintext Attack (CPA) − In this method, the attacker has the text of his choice encrypted.
So he has the ciphertext-plaintext pair of his choice. This simplifies his task of determining the
encryption key. An example of this attack is differential cryptanalysis applied against block
ciphers as well as hash functions. A popular public key cryptosystem, RSA is also vulnerable to
chosen-plaintext attacks.
 Dictionary Attack − This attack has many variants, all of which involve compiling a ‗dictionary‘.
In simplest method of this attack, attacker builds a dictionary of ciphertexts and corresponding
plaintexts that he has learnt over a period of time. In future, when an attacker gets the ciphertext, he
refers the dictionary to find the corresponding plaintext.
 Brute Force Attack (BFA) − In this method, the attacker tries to determine the key by attempting
all possible keys. If the key is 8 bits long, then the number of possible keys is 28 = 256. The attacker
knows the ciphertext and the algorithm, now he attempts all the 256 keys one by one for decryption.
The time to complete the attack would be very high if the key is long.
 Birthday Attack − This attack is a variant of brute-force technique. It is used against the
cryptographic hash function. When students in a class are asked about their birthdays, the answer is
one of the possible 365 dates. Let us assume the first student's birthdate is 3rd Aug. Then to find the
next student whose birthdate is 3rd Aug, we need to enquire 1.25*• √365 ≈ 25 students.
Similarly, if the hash function produces 64 bit hash values, the possible hash values are 1.8x1019.
If the attacker is able to find two different inputs that give the same hashvalue, it is a collision and that
hash function is said to be broken.
 Man in Middle Attack (MIM) − The targets of this attack are mostly public key cryptosystems
where key exchange is involved before communication takes place.
o Host A wants to communicate to host B, hence requests public key of B.
o An attacker intercepts this request and sends his public keyinstead.
o Thus, whatever host A sends to host B, the attacker is able to read.
 Side Channel Attack (SCA) − This type of attack is not against any particular type of
cryptosystem or algorithm. Instead, it is launched to exploit the weakness in physical
implementation of the cryptosystem.
 Timing Attacks − They exploit the fact that different computations takedifferent times to compute on
processor. By measuring such timings, it is be possible to know about a particular computation the
processor is carrying out. For example, if the encryption takes a longer time, it indicates that the
secret key is long.
 Power Analysis Attacks − These attacks are similar to timing attacks except that the amount of
power consumption is used to obtain information about the nature of the underlying computations.
 Fault analysis Attacks − In these attacks, errors are induced in the cryptosystem and the attacker
studies the resulting output for useful information.

b. Write short note on linear and differential cryptanalysis[L1][CO1] [4M]


LINEAR CRYPTANALYSIS:
Linear cryptanalysis is a known plaintext attack, in which the attacker studies probabilistic linear
relations referred to as linear approximations among parity bits of the plaintext, the Ciphertext
and the hidden key.
In this approach, the attacker acquire high probability approximations for the parity bit of the
hidden key by computing the parity bits of the known plaintexts and ciphertexts. Linear
cryptanalysis together with differential cryptanalysis are the generally used attacks on block
ciphers. The linear cryptanalysis technique was first invented by Mitsuru Matsui .
There are generally two parts to linear cryptanalysis such as
1.The first is to make linear equations associating to plaintext, Ciphertext and key bits that have a
large bias; that is whose probabilities of holding are as close as applicable to 0 0r 1.
2.The second part is to need these linear equations in conjunction with known plaintext-ciphertext
pairs to drive key bits.
The linear cryptanalysis attack is based on discovering linear approximations to define the
transformations implemented in Data Encryption Standard. This approach can discover a Data
Encryption Standard key given 243 known plaintexts, as distinguished to 247 chosen plaintexts
for differential cryptanalysis.
The objective of linear cryptanalysis is to discover an effective linear equation of the form −
P[α1,α2...αa]⊕C[β1,β2...βb]=K[γ1,γ2...γc]P[α1,α2...αa]⊕C[β1,β2...βb]=K[γ1,γ2... γc]

(where x = 0 or 1; 1≤ a, b≤ n, 1 ≤ c ≤ m, and where the α, β and γ terms represent


fixed, specific bit locations) that influence with probability p ≠ 0.5.
DIFFERENTIAL CRYPTANALYSIS:
The main objective of differential cryptanalysis is to view for statistical distributions (how values
are distributed and which one is common and uncommon) and patterns in cipher text to
provide deduce details about the key used in the cipher.
Differential cryptanalysis was firstly introduced by Biham and Shamir to interpret DES block
cipher in 1990. Differential analysis is one of the most efficient attack methods in block ciphers.
The main objective of differential cryptanalysis is to view for statistical distributions(how values
are distributed and which one is common and uncommon) and patterns in ciphertext to
provide deduce details about the key used in the cipher.
Differential analysis is a selective plaintext attack, and its basic concept is to study the
probability of differential propagation of definite plaintext differential values in the encryption
procedure.
It can separate the block cipher from the permutation area and then produce the key recovery attack
on this basis. In another term, it can find a high probabilitydifferential trail.
Finally, by inserting multiple rounds before and after the differential characteristic,
guessing Round-keys used in these rounds, encrypting plaintexts, and decrypting ciphertexts, and
it can decide the right key of block cipher.
5. a. Describe Symmetric and Asymmetric key cryptography techniques. [L2][CO1] [7M]
The encryption process where same keys are used for encrypting and
decrypting the information is known as Symmetric Key Encryption.
The study of symmetric cryptosystems is referred to as symmetric cryptography. Symmetric
cryptosystems are also sometimes referred to as secret key cryptosystems.
A few well-known examples of symmetric key encryption methods are − Digital Encryption
Standard (DES), Triple-DES (3DES), IDEA, and BLOWFISH.

The salient features of cryptosystem based on symmetric key encryption are −


 Persons using symmetric key encryption must share a common key prior to exchange of
information.
 Keys are recommended to be changed regularly to prevent any attack on the system.
 A robust mechanism needs to exist to exchange the key between the communicating parties. As
keys are required to be changed regularly, this mechanism becomes expensive and cumbersome.
 In a group of n people, to enable two-party communication between any two persons, the number of
keys required for group is n × (n – 1)/2.
 Length of Key (number of bits) in this encryption is smaller and hence, process of encryption-
decryption is faster than asymmetric key encryption.
 Processing power of computer system required to run symmetric algorithm is less.
Challenge of Symmetric Key Cryptosystem
There are two restrictive challenges of employing symmetric key cryptography.
 Key establishment − Before any communication, both the sender and the receiver need to agree on
a secret symmetric key. It requires a securekey establishment mechanism in place.
 Trust Issue − Since the sender and the receiver use the same symmetric key, there is an implicit
requirement that the sender and the receiver ‗trust‘ each other. For example, it may happen that the
receiver has lostthe key to an attacker and the sender is not informed.
ASYMMETRIC KEY ENCRYPTION
The encryption process where different keys are used for encrypting and decrypting the
information is known as Asymmetric Key Encryption. Though the keys are different, they are
mathematically related and hence, retrieving the plaintextby decrypting ciphertext is feasible.

The salient features of this encryption scheme are as follows −


 Every user in this system needs to have a pair of dissimilar keys, private key and public key. These
keys are mathematically related − when one key is used for encryption, the other can decrypt the
ciphertext back to the original plaintext.
 It requires to put the public key in public repository and the private key as a well-guarded secret.
Hence, this scheme of encryption is also called Public Key Encryption.
 Though public and private keys of the user are related, it is computationally not feasible to find one
from another. This is a strengthof this scheme.
 When Host1 needs to send data to Host2, he obtains the public key of Host2 from repository,
encrypts the data, and transmits.
 Host2 uses his private key to extract the plaintext.
 Length of Keys (number of bits) in this encryption is large and hence, the process of encryption-
decryption is slower than symmetric key encryption.
 Processing power of computer system required to run asymmetricalgorithm is higher.
 Symmetric cryptosystems are a natural concept. In contrast, public-key cryptosystems are quite
difficult to comprehend.

b.Summarize the relation between key range and key size in cryptography? [L2][CO1] [5M]
KEY RANGE
The concept of key range and key-size are related to each other. Key Range is total number of keys
from smallest to largest available key. An attacker usually is armed with the knowledge of the
cryptographic algorithm and the encrypted message, so only the actual key value remains the
challenge for the attacker.
• If the key is found, the attacker can get original plaintext message. In the brute force attack,
every possible key in the key-range is tried, until we get the right key.
• In the best case, the right key is found in the first attempt, in the worst case, the key is found in
the last attempt. On an average, the right key is found after trying half of the possible keys in the
key-range. Therefore by expanding the key range toa large extent, longer it will take for an attacker
to find the key using brute-force attack.
• The concept of key range leads to the principle of key size. The strength of a cryptographic key is
measured with the key size.
KEY SIZE
• Key size is measured in bits and is represented using binary number system. Thus if the key
range from 0 to 8, then the key size is 3 bits or in other words we can say if the size is bits then the
key range is 0 to 256. Key size may be varying, depending upon the applications and the
cryptographic algorithm being used, it can be 40 bits, 56 bits, 128 bits & so on. In order to protect
the cipher-text against the brute-force attack, the key-size should be such that the attacker can not
crack it within a specified amount of time.
• From a practical viewpoint, a 40-bit key takes about 3 hours to crack, however a 41-bit key
would take 6 hours and 42-bit key would take 12 hours & so on. This means every additional bit
doubles the amount of time required to crack the key. We can assume that 128 bit key is quite safe,
considering the capabilities of today‘s computer.

6. a. Simplify various non-cryptographic vulnerabilities. [L4][CO1] [6M]


Cryptography or cryptology is the study and practice of methodologies for secure communication
within the sight of outsiders called adversaries. A cryptographic failure is a critical web
application security vulnerability that exposes sensitive application data on a weak or non-
existent cryptographic algorithm. Those can be passwords, patient health records, business secrets,
creditcard information, email addresses, or other personal user information.
Security flaws that commonly lead to cryptography failures include:
 Transmitting secret data in plain text
 Use of old/less-secure algorithm
 Use of a hard-coded password in config files
 Improper cryptographic key management
 Insufficient randomness for cryptographic functions
 Missing encryption
 Insecure implementation of certificate validation
 Use of deprecated hash functions
 Use of outdated padding methods
 Presence of sensitive data in source control
 Use of insecure initialization vectors
A number of vulnerabilities by which cryptographic systems get affected are:-
Key Lifetimes
Key length is just a single factor in the quality of both symmetric key and open key cryptography
calculations. The more drawn out that a mystery key or private key is utilized, the more
defenseless it is to assault.
Public Key Length
Given a key of a similar length, open key cryptography, by and large, is more vulnerable to attacks
than symmetric key cryptography, especially in calculating assaults. In a considering attack, the
attacker tries the greater part of the mixes of numbers that can be utilized with the calculation to
unscramble cipher text.
Symmetric Key Length
Symmetric key encryption is liable to key inquiry assaults (additionally called animal power
assaults. In these assaults, the aggressor tries every conceivable keyuntil the point when the correct
key is found to unscramble the message. Most assaults are fruitful before all conceivable keys are
attempted.
Secure Storage of Private Keys
The security of private keys is significant for open key cryptosystems. Any individual who can
acquire a private key can utilize it to imitate the legitimate proprietor amid all interchanges and
exchanges on intranets or on the Internet. Inthis manner, private keys must be in the ownership just
of approved clients, and they should be shielded from unapproved utilize.
Strength of Protocols
Cryptography-based security advancements are executed by utilizing security conventions. For
instance, secure mail frameworks can be actualized by utilizing
the S/MIME convention, and secure system interchanges can be executed by utilizing the IPSec
suite of conventions. In like manner, secure Web interchanges can be actualized by utilizing the
TLS convention.
Randomness of Generated Keys
To keep key age from being unsurprising, keys must be produced arbitrarily. In any case, keys
that are created by PC programming are never produced in a genuinely irregular way. Best case
scenario, programming key generators utilize pseudo-irregular procedures to guarantee that for all
intents and purposes nobody can foresee what keys will be produced.
Amount of Plain Text Known to Characters
Key hunt or figuring assaults are sometimes required to uncover the substance of encoded data.
Different sorts of cryptanalysis techniques can be utilized to break encryption plans, including
known plaintext assaults and picked plaintext assaults. Aggressors can gather ciphertext to enable
them to decide the encryption key. The more plaintext that is known to aggressors, the more
noteworthy the potential thatan assailant can find the encryption key used to create ciphertext.
b. What is security approaches? Explain various methods of security approaches?[L1][CO1][6M]
1. Bottom-Up Approach: The company‘s security model is applied by system administrators or
people who are working in network security or as cyber-engineers. The main idea behind this
approach is for individuals working in this field of information systems to use their knowledge
and experience in cybersecurity to guarantee the design of a highly secure information security
model.
Advantages – An individual‘s technical expertise in their field ensures that every system
vulnerability is addressed and that the security model is able to counter any potential threats
possible.
Disadvantages – Due to the lack of cooperation between senior managers and relevant directives,
it is often not suitable for the requirements and strategies of the organisation.
2. Top-Down Approach: This type of approach is initialized and initiated by the executives of
the organization.
 They formulate policies and outline the procedures to be followed.
 Determine the project‘s priorities and expected results
 Determine liability for every action needed
Advantages And Disadvantages of top-down implementation:
Managers have the authority to issue company-wide instructions while still allowing each
person to play an integral part in keeping data safe. Compared to an individual or department, a
management-based approach incorporates more available resources and a clearer overview of the
company‘s assets and concerns.
A top-down approach generally has more lasting power and efficacy than a bottom-up
approach because it makes data protection a company-wide priority instead of placing all the
responsibility on one person or team. Data vulnerabilities exist in all offices and departments, and
each situation is unique. The only way for an information security program to work is by getting
every manager, branch, department, and employee in agreement with a company-wide plan.

7. Explain any three Substitution Techniques with example. [L2][CO1] [12M]


CAESAR CIPHER (OR) SHIFT CIPHER
The earliest known use of a substitution cipher and the simplest was by Julius Caesar. The
Caesar cipher involves replacing each letter of the alphabet with the letter standing 3 places
further down the alphabet.
e.g., Plain text : pay more money , Cipher text: SDB PRUH PRQHB
For each plaintext letter p, substitute the cipher text letter c such that C = E(p) = (p+3) mod 26
A shift may be any amount, so that general Caesar algorithm is C = E (p) = (p+k) mod 26
Where k takes on a value in the range 0 to 25. The decryption algorithm is simplyP = D(C) = (C-k)
mod 26
PLAYFAIR CIPHER
The best known multiple letter encryption cipher is the playfair, which treats diagrams
in the plaintext as single units and translates these units into cipher text digrams. The playfair
algorithm is based on the use of 5x5 matrix of letters constructed using a keyword. Let the keyword
be “MONARCHY”. The matrix is constructed by filling in the letters of the keyword (minus
duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix
with the remaining letters in alphabetical order.
 The letter ―i‖ and ―j‖ count as one letter. Plaintext is encrypted two letters at a time according to
the following rules:
 Repeating plaintext letters that would fall in the same pair are separated with a Filler letter such as
„x‟.
 Plaintext letters that fall in the same row of the matrix are each replaced by the letter to the
right, with the first element of the row following the last.
 Plaintext letters that fall in the same column are replaced by the letter beneath, with the top
element of the column following the last.
 Otherwise, each plaintext letter is replaced by the letter that lies in its own row and the column
occupied by the other plaintext letter.

Plaintext = meet me at the school house


Splitting two letters as a unit => me et me at th es ch ox ol ho us ex
Corresponding cipher text => CL KL CL RS PD IL HY AV MP HF XL IU
 Two plaintext letters that fall in the same row of the matrix are each replaced by the letter to
the right, with the first element of the row circularly following the last. For example, ar is
encrypted as RM.
 Two plaintext letters that fall in the same column are each replaced by the letter beneath,
withthe top element of the column circularly following the last. For example, mu is
encrypted as CM.
 Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and
the column occupied by the other plaintext letter. Thus, hs becomes BP and ea becomes IM.
The Playfair cipher is a great advance over simple monoalphabetic ciphers. For one
thing, whereas there are only 26 letters, there are 26 * 26 = 676 digrams, so that identification of
individual diagrams is more difficult. For these reasons, the Playfair cipher was for a long time
considered unbreakable. It was used as the standard field system by the British Army in World
War I and still enjoyed considerable use by the U.S. Army and other Allied forces during World
War II.
ONE TIME PAD CIPHER
One Time Pad algorithm is the improvement of the Vernam Cipher. It is a method of encrypting
alphabetic plain text. It is one of the Substitution techniques which converts plain text into
ciphertext. In this mechanism, we assign a number to each character of the Plain-Text.
The two requirements for the One-Time pad are
 The key should be randomly generated as long as the size of the message.
 The key is to be used to encrypt and decrypt a single message, and then it is discarded.
So encrypting every new message requires a new key of the same length as the new message in one-time
pad. The key used for a one-time pad cipher is called pad
8. a.Discuss in detail about Denial of services (DOS),Spoofing &Phishing attacks?[L2][CO1][6M]
Denial of Service
It prevents the normal use of communication facilities. This attack may have a specific target. For
example, an entity 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.

Spoofing
As it pertains to cybersecurity, is when someone or something pretends to be something else in an
attempt to gain our confidence, get access to our systems, steal data, steal money, or spread malware.
Spoofing attacks come in many forms, including:
 Email spoofing
 Website and/or URL spoofing
 Caller ID spoofing
 Text message spoofing
 GPS spoofing
 Man-in-the-middle attacks
 Extension spoofing
 IP spoofing
 Facial spoofing
For example, a spoofed email from PayPal or Amazon might inquire about purchases you never
made. Concerned about your account, you might be motivated to click the included link.
From that malicious link, scammers will send you to a web page with a malware download or a faked
login page—complete with a familiar logo and spoofed URL—for the purpose of harvesting your
username and password.
There are many more ways a spoofing attack can play out. In all of them, fraudsters rely on victims
falling for the fake. If you never doubt the legitimacy of a website and never suspect an email of
being faked, then you could become a victim of a spoofing attack at some point.
To that end, this page is all about spoofing. We'll educate you on the types of spoofs, how spoofing
works, how to discern legitimate emails and websites from fake ones, and how to avoid becoming a
target for fraudsters.
Phishing
Phishing attacks are the practice of sending fraudulent communications that appear to come from a
reputable source. It is usually done through email. The goal is to steal sensitive data like credit card
and login information, or to install malware on the victim‗s machine. Phishing is a common type of
cyber attack that everyone should learn about in order to protect themselves.

b.Infer the Principles of security in data security? [L2][CO1] [6M]


1. Confidentiality:
The degree of confidentiality determines the secrecy of the information. The principle specifies
that only the sender and receiver will be able to access the information shared between them.
Confidentiality compromises if an unauthorized person is able to access a message.
2. Authentication:
Authentication is the mechanism to identify the user or system or the entity. It ensures the
identity of the person trying to access the information. The authentication is mostly secured by
using username and password. The authorized person whose identity is preregistered can prove
his/her identity and can access the sensitive information.
3. Integrity:
Integrity gives the assurance that the information received is exact and accurate. If the content
of the message is changed after the sender sends it but before reaching the intended receiver,
then it is said that the integrity of the message is lost.
System Integrity: System Integrity assures that a system performs its intended function in an
unimpaired manner, free from deliberate or inadvertent unauthorized manipulation of the
system.
Data Integrity: Data Integrity assures that information (both stored and in transmitted
packets) and programs are changed only in a specified and authorized manner
4. Non-Repudiation:
Non-repudiation is a mechanism that prevents the denial of the message content sent through a
network. In some cases the sender sends the message and later denies it. But the non-
repudiation does not allow the sender to refuse the receiver.
5. Access control:
The principle of access control is determined by role management and rule management. Role
management determines who should access the data while rule management determines up to
what extent one can access the data.
6.Availability:
The principle of availability states that the resources will be available to authorize party
at all times. Information will not be useful if it is not available to be accessed. Systems should
have sufficient availability of information to satisfy the user request.
7. Issues of ethics and law:
The following categories are used to categorize ethical dilemmas in the security
system. Individuals‘ right to access personal information is referred to as privacy.
Property: It is concerned with the information‘s owner.
Accessibility is concerned with an organization‘s right to collect information.
Accuracy: It is concerned with the obligation of information authenticity, fidelity, and
accuracy.

9. a.Illustrate different types of transposition techniques in detail. [L3][CO1] [6M]


RAIL FENCE: (also called a zigzag cipher) is simplest of such cipher, in which the plaintext is
written down as a sequence of diagonals and then read off as a sequence of rows.
For Rail fence 3
 For rail fence 3,the plain-text is written downwards and diagonally on successive rails of an imaginary
fence.
 When we reach the bottom rail, we traverse upwards moving diagonally, after reaching the top rail, the
direction is changed again. Thus the alphabets of the message are written in a zig-zag manner.
 After each alphabet has been written, the individual rows are combined to obtain the cipher-text.

CIPHER-TEXT = ―GSGSEKFREKEOE‖
ROW TRANSPOSITION CIPHERS:
A more complex scheme is to write the message in a rectangle, row by row, and read the
message off, column by column, but permute the order of the columns. The order of columns then
becomes the key of the algorithm.
A pure transposition cipher is easily recognized because it has the same letter frequencies
as the original plaintext. The transposition cipher can be made significantly more secure by
performing more than one stage of transposition. The result is more complex permutation that is
not easily reconstructed.
Decryption
1. To decipher it, the recipient has to work out the column lengths by dividing the message length
by the key length.
2. Then, write the message out in columns again, then re-order the columns by reforming the key
word.
b.Discuss Play fair cipher in Detail. [L2][CO1] [6M]
The best known multiple letter encryption cipher is the playfair, which treats diagrams
in the plaintext as single units and translates these units into cipher text digrams. The playfair
algorithm is based on the use of 5x5 matrix of letters constructed using a keyword. Let the keyword
be “MONARCHY”. The matrix is constructed by filling in the letters of the keyword (minus
duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix
with the remaining letters in alphabetical order.
 The letter ―i‖ and ―j‖ count as one letter. Plaintext is encrypted two letters at a time according to
the following rules:
 Repeating plaintext letters that would fall in the same pair are separated with a Filler letter such as
„x‟.
 Plaintext letters that fall in the same row of the matrix are each replaced by the letter to the
right, with the first element of the row following the last.
 Plaintext letters that fall in the same column are replaced by the letter beneath, with the top
element of the column following the last.
 Otherwise, each plaintext letter is replaced by the letter that lies in its own row and the column
occupied by the other plaintext letter.

Plaintext = meet me at the school house


Splitting two letters as a unit => me et me at th es ch ox ol ho us ex
Corresponding cipher text => CL KL CL RS PD IL HY AV MP HF XL IU
 Two plaintext letters that fall in the same row of the matrix are each replaced by the letter to
the right, with the first element of the row circularly following the last. For example, ar is
encrypted as RM.
 Two plaintext letters that fall in the same column are each replaced by the letter beneath,
withthe top element of the column circularly following the last. For example, mu is
encrypted as CM.
 Otherwise, each plaintext letter in a pair is replaced by the letter that lies in its own row and
the column occupied by the other plaintext letter. Thus, hs becomes BP and ea becomes IM.
The Playfair cipher is a great advance over simple monoalphabetic ciphers. For one
thing, whereas there are only 26 letters, there are 26 * 26 = 676 digrams, so that identification of
individual diagrams is more difficult. For these reasons, the Playfair cipher was for a long time
considered unbreakable. It was used as the standard field system by the British Army in World
War I and still enjoyed considerable use by the U.S. Army and other Allied forces during World
War II.

10. Indicate any three Symmetric key cipher techniques. [L2][CO1] [12M]
CAESAR CIPHER (OR) SHIFT CIPHER
The earliest known use of a substitution cipher and the simplest was by Julius Caesar. The
Caesar cipher involves replacing each letter of the alphabet with the letter standing 3 places
further down the alphabet.
e.g., Plain text : pay more money , Cipher text: SDB PRUH PRQHB
For each plaintext letter p, substitute the cipher text letter c such that C = E(p) = (p+3) mod 26
A shift may be any amount, so that general Caesar algorithm is C = E (p) = (p+k) mod 26
Where k takes on a value in the range 0 to 25. The decryption algorithm is simplyP = D(C) = (C-k)
mod 26
MONOALPHABETIC CIPHERS:
Monoalphabetic cipher is a substitution cipher, where the cipher alphabet for eachplain text alphabet
is fixed, for the entire encryption.
In simple words, if the alphabet ‗p‘ in the plain text is replaced by the cipher alphabet ‗d‘. Then in
the entire plain text wherever alphabet ‗p‘ is used, it will bereplaced by the alphabet ‗d‘ to form the
ciphertext.
With only 25 possible keys, the Caesar cipher is far from secure. A dramatic increase in the key
space can be achieved by allowing an arbitrary substitution. A permutation of a finite set of
elements S is an ordered sequence of all the elements of S, with each element appearing exactly
once.
For example, if S = {a, b, c}, there are six permutations of S:abc, acb, bac, bca, cab, cba
In general, there are n! permutations of a set of n elements, because the first element can be chosen
in one of n ways, the second in n - 1 ways, the third in n – 2 ways, and so on.
Plain Text: 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
Caesarcipher: 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
Eg: Plain Text: Plain Text: meet me tomorrow
Cipher Text: phhw ph wrpruurz
If, instead, the ―cipher‖ line can be any permutation of the 26 alphabetic characters, then there are 26! or
greater than 4 * 1026 possible keys.
 This is 10 orders of magnitude greater than the key space for DES and would seem to eliminate
brute-force techniques for cryptanalysis. Such an approach is referred to as a mono alphabetic
substitution cipher, because a single cipher alphabet (mapping from plain alphabet to cipher alphabet) is
used per message.
 Monoalphabetic ciphers are easy to break because they reflect the frequency data of the original
alphabet.
POLYALPHABETIC CIPHER
Polyalphabetic cipher is far more secure than a monoalphabetic cipher. As monoalphabetic cipher
maps a plain text symbol or alphabet to a ciphertext symbol and uses the same ciphertext symbol
wherever that plain text occurs in the message.
 But polyalphabetic cipher, each time replaces the plain text with the different ciphertext.
 A polyalphabetic cipher is any cipher based on substitution, using multiple substitution
alphabets. The Vigenère cipher is probably the best-known example of a polyalphabetic
cipher.
UNIT-II CONVENTIONAL ENCRYPTION
1. a. Illustrate Conventional encryption model. [L3][CO2] [6M]
Conventional encryption is a cryptographic system that uses the same key used by the sender to
encrypt the message and by the receiver to decrypt the message.It was the only type of encryption in use
prior to the development of public-key encryption.
It is still much preferred of the two types of encryption systems due to its simplicity. It is a
relatively fast process since it uses a single key for both encryption and decryption
Suppose A wants to send a message to B, that message is called plaintext. Now, to avoid hackers
reading plaintext, the plaintext is encrypted using an algorithm and a secret key (at 1). This encrypted
plaintext is called ciphertext. Using the same secret key and encryption algorithm run in reverse(at 2), B
can get plaintextof A, and thus the message is read and security is maintained.
Conventional encryption has mainly 5 ingredients:

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 plaintext to
convert it into cipher text.
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. Cipher text : It contains encrypted information because it contains a form of originalplaintext 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. Cipher text andSecret
key is input here and it produces plain text as output.
Requirements for secure use of conventional encryption:
1. We need a strong encryption algorithm.
2. The sender and Receiver must have obtained copies of the secret key in a secure fashion and must
keep the key secure.
Advantages of Conventional Encryption:
1. Simple: This type of encryption is easy to carry out.
2. Uses fewer computer resources: Conventional encryption does not require a lot of computer
resourceswhen compared to public-key encryption.
3. Fast : Conventional encryption is much faster than asymmetric key encryption.
Disadvantages of Conventional Encryption Model:
1. Origin and authenticity of the message cannot be guaranteed, since bothsender and receiver use the
same key, messages cannot be verified to have come from a particular user.
2. It isn‟t much secured when compared to public-key encryption.
3. If the receiver lost the key, he/she cant decrypt the message and thus making the whole process
useless.
4. This scheme does not scale well to a large number of users because boththe sender and the receiver
have to agree on a secret key before transmission.
b. State and explain the principles of public key cryptography? [L1][CO2] [6M]
Key distribution under symmetric key encryption requires either
(1)That two communicants already share a key, which someone has been distributed to them or
(2) The use of a key distribution center.
Public key cryptosystems
Public key algorithms rely on one key for encryption and a different but related keyfor decryption.
These algorithms have the following important characteristics:
 It is computationally infeasible to determine the decryption key given only the knowledge of the
cryptographic algorithm and the encryption key.
 In addition, some algorithms, such as RSA, also exhibit the following characteristic:
 Either of the two related keys can be used for encryption, with the other used fordecryption.
The essential steps are the following:
 Each user generates a pair of keys to be used for encryption and decryption ofmessages.
 Each user places one of the two keys in a public register or other accessible file.
 This is the public key. The companion key is kept private.
 If A wishes to send a confidential message to B, A encrypts the message usingB‟s public key.
 When B receives the message, it decrypts using its private key. No other recipient can decrypt the message
because only B knows B‟s private key.
With this approach, all participants have access to public keys and private keys are generated locally by
each participant and therefore, need not be distributed. As long as a system controls its private key, its
incoming communication is secure.
Let the plaintext be X=[X1, X2, X3, …,Xm] where m is the number of letters in some finite
alphabets. Suppose A wishes to send a message to B. B generates a pair of keys: a public key KUb and a
private key KRb. KRb is known only to B, whereas KUb is publicly available and therefore accessible by
A.With the message X and encryption key KUb as input, A forms the cipher text Y=[Y1, Y2, Y3, …
Yn]., i.e., Y=E KUb(X)
The receiver can decrypt it using the private key KRb. i.e., X=D KRb(Y). The encrypted message serves
as a digital signature.
 It is important to emphasize that the encryption process just described does not provide confidentiality.
There is no protection of confidentiality because any observer can decrypt the message by using the
sender‟s public key.
 It is however, possible to provide both the authentication and confidentiality by a double use of the
public scheme.

Initially, the message is encrypted using the sender‟s private key. This provides the digital signature.
Next, we encrypt again, using the receiver‟s public key. The final ciphertext can be decrypted only by the
intendedreceiver, who alone has the matching private key. Thus confidentiality is provided.

2. Describe Hill cipher and Monoalphabetic ciphers in detail.[L2][CO2][12M]


HILL CIPHER
It is also a multi letter encryption cipher. It involves substitution of „m‟ ciphertext letters for „m’
successive plaintext letters. For substitution purposes using „m’ linear equations, each of the characters
are assigned a numerical values i.e. a=0, b=1, c=2, d=3,…….z=25. For example if m=3, the system can be
defined as: c1 = (k11p1+ k12p2 + k13p3) mod 26 ,
c2 = (k21p1 + k22p2 + k23p3) mod 26
c3 = (k31p1 + k32p2 + k33p3) mod 26
If we represent in matrix form, the above statements as matrices and column vectors:

Thus, C = KP mod26, where C= Column vectors of length 3 ,P = Column vectors of length 3 K= 3x3
encryption key matrix.
For decryption process, inverse of matrix K is done.Plaintext is recovered by applying K-1 to the cipher
text. It is expressed as C = EK(P) = KP mod26
P = DK(C) = K-1C mod26.
Example: The plain text is: I can’t do it, and the size of M is 3 and key K is chosen as following

MONOALPHABETIC CIPHERS:
Monoalphabetic cipher is a substitution cipher, where the cipher alphabet for each plain text
alphabet is fixed, for the entire encryption.
In simple words, if the alphabet „p‟ in the plain text is replaced by the cipher alphabet „d‟. Then
in the entire plain text wherever alphabet „p‟ is used, it will be replaced by the alphabet „d‟ to form the
ciphertext.
With only 25 possible keys, the Caesar cipher is far from secure. A dramatic increase in the key
space can be achieved by allowing an arbitrary substitution. A permutation of a finite set of elements S is
an ordered sequence of all the elements of S, with each element appearing exactly once.
For example, if S = {a, b, c}, there are six permutations of S:abc, acb, bac, bca, cab, cba
In general, there are n! permutations of a set of n elements, because the first element can be chosen in one
of n ways, the second in n - 1 ways, the third in n – 2 ways, and so on.
Plain Text: 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
Caesarcipher: 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
Eg: Plain Text: meet me tomorrow
Cipher Text: phhw ph wrpruurz
 If, instead, the “cipher” line can be any permutation of the 26 alphabetic characters, then thereare 26! or
greater than 4 * 1026 possible keys.
 This is 10 orders of magnitude greater than the key space for DES and would seem to eliminate brute-
force techniques for cryptanalysis. Such an approach is referred to as a mono alphabetic substitution
cipher, because a single cipher alphabet (mapping from plain alphabet to cipher alphabet) is used per
message.
 Monoalphabetic ciphers are easy to break because they reflect the frequency data of the originalalphabet.

3. a. Explain Double &Triple DES with keys.[L2][CO2][8M]


DOUBLE DES
The Data Encryption Standard (DES) is a symmetric key block cipher which creates64-bit plaintext and 56-
bit key as an input and makes 64-bit cipher text as output. The DES function is create up of P and S-boxes.
P-boxes transpose bits and S-boxessubstitute bits to make a cipher.
DES is a Feistel Block Cipher implementation, called a LUCIFER. It need a Feistelstructure with 16
rounds, where a different key can be used for each round. The major reasons to understand DES (Data
Encryption Standard) is that it forms the foundation for encryption algorithms. This creates it easy for one
to learn the implementation or operating of currently used encryption algorithms or methods, which are
much quicker than the DES algorithm.
Double DES is an encryption approach which uses two example of DES on same plain text. In
both examples it provides different keys to encode the plain text. Double DES is easily to learn.
Double DES uses two keys, such as k1and k2. It can implement DES on the original plain text using k1 to
get the encrypted text. It can implement DES on the encrypted text, but this time with the different key k2.
The final output is the encryption of encrypted text as shown in the figure.

The double encrypted cipher-text block is first decrypted using the key K2 to make the singly encrypted
cipher text. This ciphertext block is then decrypted using the key K1 to acquire the original plaintext
block.

If it can use a key of only 1 bit, there are two possible keys including 0 and 1. If it can use a 2
bit key, there are four possible key values such as (00, 01, 10 and 11). In general, if it can use an n-bit key,
the cryptanalyst has to implement 2n operations to try out all the possible keys. If it can use two different
keys, each including n bits,the cryptanalyst would require 22n attempt to crack the key.
Double DES needed a key search of (22*56), i. e. , 2112keys. It introduce the terms of the meet-in-
the-middle attack. This attack contains encryption from one end, decryption from the other and
connecting the results in the middle.
Consider that the cryptanalyst understand two basic pieces of information including P (a plain-
text block) and C (the corresponding final cipher-text block) for a message. The numerical expression of
Double DES as shown in the figure.

The result of the first encryption is known as T and is indicated as T = Ek1(P) [i.e., encrypt the block P
with key K1]. After this encrypted block is encrypted with another key K2, it indicate the result as C =
EK2(EK1(P)) [i.e., encrypt the already encrypted block T, with a different key K2, and call the final
ciphertext as C].
TRIPLE DES
The speed of exhaustive key searches against DES after 1990 began to cause discomfort amongst
users of DES. However, users did not want to replace DES as it takes an enormous amount of time and
money to change encryption algorithms that are widely adopted and embedded in large security
architectures.
The pragmatic approach was not to abandon the DES completely, but to change the manner in
which DES is used. This led to the modified schemes of Triple DES (sometimes known as 3DES).
Incidentally, there are two variants of Triple DES known as 3-key Triple DES (3TDES) and 2-key Triple
DES (2TDES).
3-KEY Triple DES
Before using 3TDES, user first generate and distribute a 3TDES key K, which consists of three different
DES keys K1, K2 and K3. This means that the actual 3TDES key has length 3×56 = 168 bits. The
encryption scheme is illustrated as follows −

The encryption-decryption process is as follows −


 Encrypt the plaintext blocks using single DES with key K1.
 Now decrypt the output of step 1 using single DES with key K2.
 Finally, encrypt the output of step 2 using single DES with key K3.
 The output of step 3 is the ciphertext.
 Decryption of a ciphertext is a reverse process. User first decrypt using K3, then encrypt with K2, and
finally decrypt with K1.
Due to this design of Triple DES as an encrypt–decrypt–encrypt process, it is possible to use a
3TDES (hardware) implementation for single DES by settingK1, K2, and K3 to be the same value. This
provides backwards compatibility with DES.
Second variant of Triple DES (2TDES) is identical to 3TDES except that K3is replaced by K1. In other
words, user encrypt plaintext blocks with key K1, then decrypt with key K2, and finally encrypt with K1
again. Therefore, 2TDES has a keylength of 112 bits.
Triple DES systems are significantly more secure than single DES, but these are clearly a much slower
process than encryption using single DES.

b.Derive Ceasar cipher algorithm, encrypts the message using the Plain Text"POLYMORPHIC" and Key
k=3.[L3][CO2][4M]
The earliest known use of a substitution cipher and the simplest was by Julius Caesar. The Caesar cipher
involves replacing each letter of the alphabet with the letter standing 3 places further down the
alphabet.
PLAIN TEXT = POLYMORPHIC, KEY=3, CIPHER TEXT = SROBPRUSKLF
For each plaintext letter p, substitute the cipher text letter c such that C = E(p) = (p+3) mod 26
A shift may be any amount, so that general Caesar algorithm is C = E (p) = (p+k) mod 26
Where k takes on a value in the range 0 to 25.
The decryption algorithm is simplyP = D(C) = (C-k) mod 26

4. Summarize one time pad and Polyalphabetic cipher methods with example. [L4][CO2][12M]
ONE TIME PAD CIPHER
One Time Pad algorithm is the improvement of the Vernam Cipher. It is a method of encrypting
alphabetic plain text. It is one of the Substitution techniques which converts plain text into ciphertext.
In this mechanism, we assign a number to each character of the Plain-Text.
The two requirements for the One-Time pad are
 The key should be randomly generated as long as the size of the message.
 The key is to be used to encrypt and decrypt a single message, and then it is discarded.
So encrypting every new message requires a new key of the same length as the new message in one -
time pad. The key used for a one-time pad cipher is called pad.

Advantage:
Encryption method is completely unbreakable for a ciphertext only attack.
Disadvantages
It requires a very long key which is expensive to produce and expensive to transmit.
Once a key is used, it is dangerous to reuse it for a second message; any knowledge on the first message
would give knowledge of the second.
POLYALPHABETIC CIPHER
Polyalphabetic cipher is far more secure than a monoalphabetic cipher. As monoalphabetic cipher maps a
plain text symbol or alphabet to a ciphertext symbol and uses the same ciphertext symbol wherever that
plain text occurs in the message.
 But polyalphabetic cipher, each time replaces the plain text with the different ciphertext.
 A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. The
Vigenère cipher is probably the best-known example of a polyalphabetic cipher.
Strength of Vigenere cipher

 There are multiple cipher text letters for each plaintext letter.
 Letter frequency information is obscured.

5. a. Explain Rail fence Technique and Row Columnar techniques.[L2][CO2][6M]


RAIL FENCE: (also called a zigzag cipher) is simplest of such cipher, in which the plaintext is written
down as a sequence of diagonals and then read off as a sequence of rows.
For Rail fence 2

For Rail fence 3


 For rail fence 3,the plain-text is written downwards and diagonally on successive rails of an
imaginary fence.
 When we reach the bottom rail, we traverse upwards moving diagonally, after reaching the top rail,
the direction is changed again. Thus the alphabets of the message are written in a zig-zag manner.
 After each alphabet has been written, the individual rows are combined to obtain the cipher-text.

CIPHER-TEXT = “GSGSEKFREKEOE”
ROW TRANSPOSITION CIPHERS:
A more complex scheme is to write the message in a rectangle, row by row, and read the message off,
column by column, but permute the order of the columns.The order of columns then becomes the key of the
algorithm.
A pure transposition cipher is easily recognized because it has the same letter frequencies as the original
plaintext. The transposition cipher can be made significantly more secure by performing more than
one stage of transposition. The result is more complex permutation thatis not easily reconstructed.
Decryption
1. To decipher it, the recipient has to work out the column lengths by dividing the message length by
the key length.
2. Then, write the message out in columns again, then re-order the columns by reforming the key word.

b.Categorize any two Substitution Techniques in symmetric key cryptography.[L4][CO2][6M]


CAESAR CIPHER (OR) SHIFT CIPHER
The earliest known use of a substitution cipher and the simplest was by Julius Caesar. The Caesar cipher
involves replacing each letter of the alphabet with the letter standing 3 places further down the
alphabet.
e.g., Plain text : pay more money , Cipher text: SDB PRUH PRQHB
For each plaintext letter p, substitute the cipher text letter c such that C = E(p) = (p+3) mod 26
A shift may be any amount, so that general Caesar algorithm is C = E (p) = (p+k) mod 26
Where k takes on a value in the range 0 to 25.
The decryption algorithm is simplyP = D(C) = (C-k) mod 26
ONE TIME PAD CIPHER
One Time Pad algorithm is the improvement of the Vernam Cipher. It is a method of encrypting
alphabetic plain text. It is one of the Substitution techniques which converts plain text into ciphertext.
In this mechanism, we assign a number to each character of the Plain-Text.
The two requirements for the One-Time pad are
 The key should be randomly generated as long as the size of the message.
 The key is to be used to encrypt and decrypt a single message, and then it is discarded.
So encrypting every new message requires a new key of the same length as the new message in one -
time pad. The key used for a one-time pad cipher is called pad.
6. a. Establish Affine cipher Encryption and Decryption process using the keyword
"MONARCHY" and keys a=3, b=5. [L3][CO2][7M]

AFFINE CIPHER
The Affine cipher is a type of mono alphabetic substitution cipher, where in each letter in an
alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and
converted back to a letter.
The whole process relies on working modulo m (the length of the alphabet used). In the affine
cipher, the letters of an alphabet of size m are first mapped to the integers in the range 0 … m-1.
The „key‟ for the Affine cipher consists of 2 numbers, we‟ll call them a and b. The following discussion
assumes the use of a 26 character alphabet (m = 26). a should be chosen to be relatively prime to m (i.e. a
should have no factors in common with m).

Encryption
It uses modular arithmetic to transform the integer that each plaintext letter corresponds to into another
integer that correspond to a ciphertext letter. The encryption function for a single letter is
E ( x ) = ( a x + b ) mod m ,
Modulus m: size of the alphabet
a and b: key of the cipher, where a must be chosen such that a and m are coprime.

Decryption
In deciphering the ciphertext, we must perform the opposite (or inverse) functions on the cipher text to
retrieve the plaintext. Once again, the first step is to convert each of the cipher text letters into their
integer values. The decryption function is
D ( x ) = a^-1 ( x - b ) mod m
a^-1 : modular multiplicative inverse of a modulo m.

To find a multiplicative inverse


We need to find a number x such that:
If we find the number x such that the equation is true, then x is the inverse of a, andwe call it
a^-1 = a*x mod 26 =1, If you now multiply x and a and reduce the result (mod 26), you will get the
answer 1.
b. Compare conventional key with public key encryption.[L5][CO2][5M]
Parameters of
Conventional Key Encryption Public Key Encryption
Comparison
The first cypher to employ a correct Diffie and Hellman invented the public-key
Invented By encryption key was created accordingto cryptosystemmodel.
Giovan Battista Bellaso.
Number of Only one key is required. Two keys are used by thesender and recipient.
Keys
Algorithms Either logic algorithms or mathematical Both logic and arithmeticalgorithms are used.
Used algorithms.
Symmetry Symmetric in nature. Asymmetric in nature.
Since it employs a simple cryptosystem Is secured and more reliable than the traditional
Security and decryption, it is a reasonably quick conventional key encryption.
procedure and less secured.

7. Demonstrate single round DES with neat sketch.[L2][CO2][12M]


The left and right halves of each 64-bit intermediate value are treated as separate 32-bit quantities, labeled
L (left) and R (right). As in any classic Feistel cipher, the overall processing at each round can be
summarized in the following formulas:

The round key is 48 bits. The input is 32 bits. This input is first expanded to 48 bits by using a table that
defines a permutation plus an expansion that involves duplication of 16 of the bits.
The resulting 48 bits are XOR ed . This 48-bit result passes through a substitution function that produces
a 32-bit output.

64 bit plain text goes under initial permutation and then given to round 1. Since initial permutation
step receiving 64 bits, it contains an 1×64 matrix which contains numbers from 1 to 64 but in shuffled
order. After that, we arrange our original 64 bit text in the order mentioned in that matrix.
After initial permutation, 64 bit text passed through 16 rounds. In each round it processed with 48 bit
key. That means we need total 16 sub keys, one for each round. See below diagram, it will show what
happening in each round of algorithm.
Round i: In each round 64bit text divided into two 32bit parts. Left and Right. You can see in diagram Li-1
and Ri-1. As algorithm says, Right 32bits goes under Expansion Permutation.
Expansion Permutation: Right side 32bit part of text given to expansion permutation. It will produce a
48bit text as output. i.e. 16bits added in this step. Some bits below 32 are repeated and arranged in an
1×48 matrix form. We rearrange 32bit text by following the order of that matrix. After expansion
permutation we have to XOR the output 48bit with a 48bit sub key. Let see how that 48bit sub key
generating from 64bit original key.
Permutated Choice 1: Initially we take a 64 bit key and then apply to permutated choice 1. It contains a
1×56 matrix but with shuffled 1 to 64 numbers except multiples of number 8. i.e. 8, 16, 24, 32, 40, 48, 56,
64 will be discarded.
Remaining 64-8 = 56 number will be there in 1×56 matrix. We rearrange key inmatrix specified order.
Left Circular Shift: 56 bit key from permutated choice 1 given to left circular shift operation. Here that
56 bit key divided into two equal halves of each 28bit. These 28bits shifted depends upon the round
number. We already have the data that in each round how many bits circularly we have to shift. You can
see this data in shifts array in code.
Permutated Choice 2: Result of Left circular shift 56bit key given to permutated choice 2. This step will
produce 48bit sub key. For this it has an 1×48 matrix, in which out of 56, some random 8 bits will be
discarded. And remaining 48 will be there. According to this bit positions we have to rearrange the key.
You can see this matrix in below code.
Now output of permutated choice 2 will be Xor with output of expansion permutation, which results a
48bit one. This 48bit again reduced to 32bit using Substitution boxes [called S box].
Substitution boxes [S box]:

In DES algorithm we have 8 S boxes. Input for S box is 48bit. And output from S box is 32 bit.
The input 48 bit will be divided equally to 8 s boxes from s1, s2, … s8. So each s box will get 48/8= 6
bits as input. This Each S box reduce 6 bits to 4 bits. i.e input for each S box is 6 bits and output is 4 bits.
Finally, 8*4 = 32 bit. Which is final output of S box operation.
Let see how 6bits converted to 4 bits from S box. S box is an 4×16 matrix containing numbers in
range 0 to 15. Take example, assume input 6 bits for S box are 011011. In this first and last bit together
represents row number. Since maximum number with two bits is 3, S box also contains 0 to 3 rows total
of 4 and middle 4 numbers together represent column number.
Since maximum number with 4 bits is 15, S box also contains columns 0 to 15 total of 16. So
here first and last bit = 01 i.e. row number 1 and middle bits 1101= 13 i.e. column number 13. So for this
input the number positioned at row 1 and column 13 will be picked. As mentioned earlier S box only
contains number in range 0 to 15. All can be represented in 4 bits. So picked number 4 bits are output for
the S box.
Permutation: After getting output from all S boxes, we are applying again permutation. Here also a
matrix with different arrangements will be there, we haveto arrange according to that.
Final XOR: After this permutation, take the left half which initially divided 64bit text to two halves. Do
XOR with this permutation output to left 32bit part. This result is new Right part. And Right 32bit part
which passed through all permutation will be come as new Left Part. These 2 parts will be the inputs for
thesecond round. Same as keys also, the parts before left shift are next round input keys.
All this explanation for a single round for a 62bit plain text. Like this, it passesthrough total 16 rounds.
32 bit swap: After completion of 16 rounds, final 64 bits divided into two 32 bit parts and they swap
each other.
Inverse Initial Permutation: Here also a matrix will be there, in which bits arejust shuffled. No adding
or subtracting bits. See the code for this matrix.

8. Write short notes on block cipher principles? Explain the block cipher modes of
operation. [L1][CO2][12M]
Feistel Cipher is not a specific scheme of block cipher. It is a design model from which many
different block ciphers are derived. DES is just one example of a Feistel Cipher. A cryptographic system
based on Feistel cipher structure uses the same algorithm for both encryption and decryption.
Encryption Process
The encryption process uses the Feistel structure consisting multiple rounds of processing of the plaintext,
each round consisting of a “substitution” step followed by a permutation step.
Encryption algorithms are divided into two categories based on the input type, asa block cipher
and stream cipher. Block cipher is an encryption algorithm that takes a fixed size of input say b bits and
produces a ciphertext of b bits again. If the input is larger than b bits it can be divided further.
Block cipher modes of operation
Electronic Code Book (ECB) – Electronic code book is the easiest block cipher mode of functioning. It
is easier because of direct encryption of each block of input plaintext and output is in form of blocks of
encrypted ciphertext. Generally, if a message is larger than b bits in size, it can be broken down into a
bunch of blocks and the procedure is repeated.

Advantages of using ECB –


 Parallel encryption of blocks of bits is possible, thus it is a faster way ofencryption.
 Simple way of the block cipher.
Disadvantages of using ECB –
 Prone to cryptanalysis since there is a direct relationship betweenplaintext and ciphertext.
Cipher Block Chaining (CBC) - Cipher block chaining or CBC is an advancement made on ECB
since ECB compromises some security requirements. In CBC, the previous cipher block isgiven as input
to the next encryption algorithm after XOR with the original plaintext block. In a nutshell here, a cipher
block is produced by encrypting an XOR output of the previous cipher block and present plaintext block.
Advantages of CBC –

 CBC works well for input greater than b bits.


 CBC is a good authentication mechanism.
 Better resistive nature towards cryptanalysis than ECB.
Disadvantages of CBC –
 Parallel encryption is not possible since every encryption requires aprevious cipher.
Cipher Feedback Mode (CFB) – In this mode the cipher is given as feedback to the next block of
encryption with some new specifications: first, an initial vector IV is used for first encryption and output
bits are divided as a set of s and b-s bits.The left-hand side s bits are selected along with plaintext bits to
which an XOR operation is applied. The result is given as input to a shift register having b-s bits to lhs,s
bits to rhs and theprocess continues.
Advantages of CFB –
 Since, there is some data loss due to the use of shift register, thus it isdifficult for applying
cryptanalysis.
Output Feedback Mode(OFB) –The output feedback mode follows nearly the same process as the
Cipher Feedback mode except that it sends the encrypted output as feedback instead of the actual cipher
which is XOR output. In this output feedback mode, all bits of the block are sent instead of sending
selected s bits. The Output Feedback mode of block cipher holds great resistance towards bit
transmission errors. It also decreases the dependency or relationship of the cipher on the plaintext.
Advantages of OFB –
 In the case of CFB, a single bit error in a block is propagated to all subsequent blocks. This problem
is solved by OFB as it is free from bit errors in the plaintext block.

Counter Mode (CM) – The Counter Mode or CTR is a simple counter-based block cipher
implementation. Every time a counter-initiated value is encrypted and given as input to XOR with
plaintext which results in ciphertext block. The CTR mode is independent of feedback use and thus can
be implemented in parallel. Its simple implementation is shown below:

Advantages of Counter
 Since there is a different counter value for each block, the direct plaintext and ciphertext relationship
is avoided. This means that thesame plain text can map to different ciphertext.
 Parallel execution of encryption is possible as outputs from previousstages are not chained as in the
case of CBC.

9. a.Infer the Principles of Stream Cipher and Block cipher.[L2][CO2][6M]


A block cipher is a symmetric cryptographic technique which we used to encrypt a fixed-size
data block using a shared, secret key. During encryption, we used plaintext and ciphertext is the
resultant encrypted text. It uses the same key to encrypt both the plaintext, and the ciphertext.
A block cipher processes the data blocks of fixed size. Typically, a message's size exceeds a
block's size. As a result, the lengthy message is broken up into a number of sequential message blocks,
and the cipher operates on these blocks one at a time.
With the help of the shared secret key, a block cipher encrypts and decrypts its input one block rather than
one bit at a time. Since the block's size is fixed, padding is not necessary. It is a symmetric algorithm.
During encryption, it converts text input into cyphertext using the shared key. It uses the same key during
decryption to change the cyphertext back to the original plaintext. The length of the output and input are
identical.
Stream Cipher
A stream cipher uses time-varying changes on plaintext data to encrypt a continuous string of
binary numbers. As a result, this method of encryption works bit-by-bit, utilising keystreams to generate
ciphertext for arbitrary lengths of plain text messages.
The cipher combines a key (128/256 bits) and a nonce digit (64-128 bits) in order to generate
the keystream - a pseudorandom number XORed with the plaintext to generate the ciphertext. The
keystream must be different for each encryption iteration even though the key and nonce can be reused to
maintain security.
In order to build the keystream, stream encryption ciphers generate a unique nonce (a number used only
once utilising feedback shift registers.

If hackers defeat the encryption algorithm, they are able to add to or change the encrypted
message without being noticed. Stream ciphers are typically used to encrypt data in an application where
the volume of plain text cannot be predicted and in low latency use-cases.
Types of Stream Ciphers
1. Synchronous Stream Ciphers
In a synchronous stream cipher, the keystream block is created independently of the previous
ciphertext and plaintext messages. The most popular stream cipher modes produce a string of bits using
pseudorandom number generators and combine it with the key to create the keystream, which is
then XORed with the plaintext to produce the ciphertext.
2. Self-Synchronizing/Asynchronous stream Ciphers
The previous ciphertext block's fixed size (N-bits) and symmetric key are used to generate the keystream
block via a self-synchronizing stream cipher, also known as ciphertext autokey. Asynchronous stream
cipher can recognize active attacks by altering the ciphertext, which changes the information in the
subsequent keystream.
b.Discuss key distribution in detail. [L2][CO2][6M]
For symmetric encryption to work, the two parties to an exchange must share the same key, and that key
must be protected from access by others. Furthermore, frequent key changes are usually desirable to limit
the amount of data compromised if an attacker learns the key. For two parties A and B, key distribution
can be achieved in a number of ways, as follows:
1. A can select a key and physically deliver it to B.
2. A third party can select the key and physically deliver it to A and B.
3. If A and B have previously and recently used a key, one party can transmitthe new key to the other,
encrypted using the old key.
4. If A and B each has an encrypted connection to a third party C, C can delivera key on the encrypted
links to A and B.
The use of a key distribution center is based on the use of a hierarchy of keys. At a minimum, two
levels of keys are used. Communication between end systems is encrypted using a temporary key, often
referred to as a session key. Accordingly, session keys are transmitted in encrypted form, using a master
key that is shared by the key distribution center and an end system or user.
The Use of a Key Hierarchy

A Key Distribution Scenario


Let us assume that user A wishes to establish a logical connection with B and requires a one-time session
key to protect the data transmitted over the connection. A has a master key, Ka, known only to itself and
the KDC; similarly, B shares the master key Kb with the KDC.
The following steps occur:
The KDC responds with a message encrypted using Ka Thus, A is the only one who can successfully read
the message, and A knows that it originated at the KDC.
The message includes two items intended for A:
 The one-time session key, Ks, to be used for the session
 The original request message, including the nonce, to enable A to match this response with the
appropriate request
Hierarchical Key Control
It is not necessary to limit the key distribution function to a single KDC. Indeed, for very large networks,
it may not be practical to do so. A hierarchical scheme minimizes the effort involved in master key
distribution, because most master keys are those shared by a local KDC with its local entities.
Session Key Lifetime
The more frequently session keys are exchanged, the more secure they are, because the opponent has less
cipher text to work with for any given session key. On the other hand, the distribution of session keys
delays the start of any exchange and places a burden on network capacity.
A Transparent Key Control Scheme
The approach assumes that communication makes use of a connection- oriented end-to-end protocol, such
as TCP. The noteworthy element of this approach is a session security module (SSM), which may
consists of functionality at one protocol layer that performs end-to-end encryption and obtains session
keyson behalf of its host or terminal.

Automatic Key Distribution for Connection-Oriented Protocol


When one host wishes to set up a connection to another host, it transmits a connection-requestpacket (step
1). The SSM saves that packet and applies to the KDC for permission to establish the connection (step 2).
The communication between the SSM and the KDC is encrypted using a master key shared only by this
SSM and the KDC. If the KDC approves the connection request, it generates the session key and delivers
it to the two appropriate SSMs, using a unique permanent key for each SSM (step 3). The requesting SSM
can now release the connection request packet, and a connection is set up between the two end systems
(step 4). All user data exchanged between the two end systems are encrypted by their respective SSMs
using the one-time session key.

10. Examine the general structure of DES with neat sketch.[L4][CO2][12M]


The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National
Institute of Standards and Technology (NIST).
DES is an implementation of a Feistel Cipher. It uses 16 round Feistel structure. Theblock size is
64-bit. Though, key length is 64-bit, DES has an effective key length of 56 bits, since 8 of the 64 bits of
the key are not used by the encryption algorithm (functionas check bits only).

Looking at the left-hand side of the figure, we can see that the processing of the plaintext proceeds in three
phases. First, the 64-bit plaintext passes through an initial permutation (IP) that rearranges the bits to
produce the permuted input. This is followed by a phase consisting of 16 rounds of the same function,
which involves both permutation and substitution functions. The output of the last (sixteenth) round
consists of 64 bits that are a function of the input plaintext and the key. The left and right halves of the
output are swapped to produce the preoutput.
Finally, the preoutput is passed through a permutation (IP-1) that is the inverse of the initial
permutation function, to produce the 64-bit ciphertext. With the exception of the initial and final
permutations, DES has the exact structure of a Feistel cipher.
Initial Permutation: The initial permutation and its inverse are defined by tables.The input to a table
consists of 64 bits numbered from 1 to 64.The 64 entries in the permutation table contain a permutation of
the numbers from 1 to 64.

Round Function
The heart of this cipher is the DES function, f. The DES function applies a 48-bit key to the right most
32 bits to produce a 32-bit output.

Expansion Permutation Box: Since right input is 32-bit and round key is a 48-bit, we first need to
expand right input to 48 bits. Permutation logic isgraphically depicted in the following illustration
 XOR (Whitener). − After the expansion permutation, DES does XOR operation on the expanded right
section and the round key. The round key is used only in this operation.
 Substitution Boxes. − The S-boxes carry out the real mixing (confusion). DES uses 8 S-boxes, each
with a 6-bit input and a 4-bit output. Refer thefollowing illustration –

There are a total of eight S-box tables. The output of all eight s-boxes isthen combined in to 32 bit
section.
Key Generation
The round-key generator creates sixteen 48-bit keys out of a 56-bit cipher key. Each entry in the
permutation table indicates the position of a numbered input bit in the output, which also consists of 64
bits.
UNIT-III ASYMMETRIC KEY CIPHERS

1. a.Explain the RSA algorithm. Compute cipher text for M=88, p=17, q=11, e=7.[L2][CO3] [8M]
 It is the most common public key algorithm.This RSA name is get from its inventors first letter
(Rivest (R), Shamir (S) and Adleman (A)) in the year 1977.
 The RSA scheme is a block cipher in which the plaintext & ciphertext are integers between 0 and
n-1 for some n.
Description of the Algorithm:
RSA algorithm uses an expression with exponentials.
 In RSA plaintext is encrypted in blocks, with each block having a binary value less than some
number n. That is, the block size must be less than or equal to log2(n)
 RSA uses two exponents e and d where e public and d private.
 Encryption and decryption are of following form, for some PlainText M and CipherText block C

Both sender and receiver must know the value of n. The sender knows the value of e & only the
receiver knows the value of d thus this is a public key encryption algorithm with a Public key
PU={e, n} Private key PR={d, n}.
Steps of RSA algorithm:
Step 1→Select 2 prime numbers p & q
Step 2→Calculate n=pq
Step 3→Calculate Ø(n)=(p-1)(q-1)
Step 4→ Select or find integer e (public key) which is relatively prime to Ø(n). ie., e with gcd
(Ø(n), e)=1 where 1<e< Ø(n).
Step 5→ Calculate “d” (private key) by using following condition. d< Ø(n).
Step 6→ Perform encryption by using
Step 7→ performDecryption by using

Example:
1. Select two prime numbers, p = 17 and q = 11.
2. Calculate n = pq = 17 × 11 = 187. 3.
3.Calculate Ø(n) = (p - 1)(q - 1) = 16 × 10 = 160.
4. Select e such that e is relatively prime to Ø(n) = 160 and less than Ø (n); we choose e = 7.
5. Determine d such that de ≡1 (mod 160) and d < 160.The correct value is d = 23, because 23 * 7 =
161 = (1 × 160) + 1; d can be calculated using the extended Euclid‟s algorithm
6. The resulting keys are public key PU = {7, 187} and private key PR = {23, 187}.
plaintext input of M= 88.
b. Write about the strength of RSA?[L1][CO3][4M]
 It is very easy to implement RSA algorithm.
 RSA algorithm is safe and secure for transmitting confidential data.
 Cracking RSA algorithm is very difficult as it involves complex mathematics.
 Sharing public key to users is easy.
 Encryption strength totally lies on the key size and if we double or triple the key size, the strength
of encryption increases exponentially.
 RSA keys can be typically 1024 or 2048 bits long, but experts believe that 1024-bit keys could be
broken in the near future.

2. Compute Cipher text for Plain text =”DECRYPTION”, P=11, D=3, E1=2,
R=4(Random Integer) plain text=7,using Elgamal Cryptography [L3][CO3][12M]

DESCRIPTION OF ELGAMAL ALGORITHM:


1.Key generation:
a)Select large prime number ‗p„
b)Select decryption key/private key(D)
c)Select second part of encryption key (or)public key(E1)
d)Third part of the encryption key(or) public key(E2),E2=E1 mod p
e)Public key=(E1,E2,P),private key=D
2.Encryption :
a)Select random integer(R)
b)C1=E1^R mod P
c)C2=(PT*E2R) mod P
d)CT=(C1,C2)
3.Decryption:
PT=[C2*(C1p)-1]mod P
3. a.Illustrate the structure of Diffie-Hellman Key Exchange and Calculate Diffie-
Hellman Key Exchange algorithm using keys q=7, Xa =3, Xb=4, α=2.[L4][CO3][7M]
Algorithm:
1. Consider a prime number „q‟
2. Select  such that it must be the premique root of q and (<q)
„a‟ is primitive root of q
Q1 mod q
Q2 mod q
Q3 mod q………. qq-1 mod q Given result {1,2,3, q-1}
Values should not be repeated
 and q are global element
3. Assume X A ( private of A key ) and X A<q Calculate YA=XA mod q
(public key of A)
4. Assume XB (private of B key ) Calculate YB = XB mod q
5. Calculate secret key both the sender and receiver will use public key K1=K2
K1=(YA)XA mod q K2=(YB)XB mod q

Solution:
Given, q=7 , Xb=4 , Xa=3
According to algorithm,
Step 1: q=7
Step 2:α=3
Step 3: Ya=αXa mod q
=33 mod 7
=6
Step 4: Yb=αXb mod q
=34 mod 7
=4
Step 5:
K1=(Ya)Xb mod q
=64 mod 7
=1
K2=(Yb)Xa mod q
=43 mod 7
=1

b. Establish Digital Signature Algorithm using RSA.[L3][CO3][5M]


A digital signature is a technique used to validate the authenticity and integrity of a
message. A digital signature is a technique that binds a person/entity to the digital data. This
binding can be independently verified by receiver as well as any third party.
Process of Digital Signature: The sender uses a signing algorithm to sign the message. The
message and the signature are sent to the receiver. The receiver receives the message and the
signature and applies the verifying algorithm to the combination. If the result is true, the message is
accepted; otherwise, it is rejected.
Services:
Message Authentication : A secure digital signature scheme, like a secure conventional signature
can provide message authentication
Message Integrity: The integrity of the message is preserved even if we sign the whole message
because we cannot get the same signature if the message is changed.
Nonrepudiation: Nonrepudiation can be provided using a trusted party.

The operation of the digital signature is similar to that of the MAC. In the case of the digital
signature, the hash value of a message is encrypted with a user‟s private key. Anyone who knows
the user‟s public key can verify the integrity of the message that is associated with the digital
signature. In this case, an attacker who wishes to alter the message would need to know the user‟s
private key.
RSA Digital Signature Schemes – Key Generation Key generation in the RSA digital signature
scheme is exactly the same as key generation in the RSA.
1. Sender chooses two prime numbers p and q
2. Calculate n=pxq
3. Calculate f(n) = (p-1) x (q-1)
4. Chooses the public exponent e and calculates d (private exponent) such that e x d = 1 mod f(n) In
the RSA digital signature scheme, d is private; e and n are public.

Properties of digital signature:


It must verify the author and the date and time of the signature.
It must to authenticate the contents at the time of the signature.
It must be verifiable by third parties, to resolve disputes.
4. Generalize the structure of DSA and its algorithms.[L2][CO3][12M]
A digital signature is a technique used to validate the authenticity and integrity of a
message. A digital signature is a technique that binds a person/entity to the digital data. This
binding can be independently verified by receiver as well as any third party.
Process of Digital Signature: The sender uses a signing algorithm to sign the message. The
message and the signature are sent to the receiver. The receiver receives the message and the
signature and applies the verifying algorithm to the combination. If the result is true, the message is
accepted; otherwise, it is rejected.
Services:
Message Authentication : A secure digital signature scheme, like a secure conventional signature
can provide message authentication
Message Integrity: The integrity of the message is preserved even if we sign the whole message
because we cannot get the same signature if the message is changed.
Nonrepudiation: Nonrepudiation can be provided using a trusted party.
Description of DSA Algorithm :
1.Key Generation:
a) Select a prime division q
b) Select a prime number p i.e, p-1 mod q=0
c) Select any integer g (1<g<p) i.e, g**q mod p =1
g=h**((p-1)q)mod p d)Select any random integer x ( private key )ie, 0<x<q
e) Calculate Y ( public key ) y=gx mod p
f) Private key (p,q,g,x)
g) Public key (p,g,q,y)
2.Signature Generation:
a) Messages passing through a hash function to generate a digest (h)
b) Chose any random integer K i.e,0<K<q
c) To calculate the value of r r=(gK mod p )mod q
d) To calculate the value of S s =[K-1 (h+x*r)mod q]
e) Signature (r,s)
4. Signature Verification:
a) Calculate the message digest using same hash function.
b) compute the value of w s*w mod q=1
c) compute the value of u1 u1=h*w mod q
d) compute the value of u2 u2=r*w mod q
e) finally the verification component v. v=[((gu1*yu2)mod p)mod q)
if v= = r,then the signature verification is successful.

Properties of digital signature:


It must verify the author and the date and time of the signature.
It must to authenticate the contents at the time of the signature.
It must be verifiable by third parties, to resolve disputes.
Attacks on Digital Signature:
1. Key-Only Attack: In key-only attack, the public key of A is available to every one and C makes
use of this fact and try to recreate the signature of A and digitally sign the documents that A does
not intend to do.
2. Known-MessageAttack: In the known message attack, C has few previous messages and
signatures of A. Now C tries to forge the signature of A on to the documents that A does not intend
to sign by using the brute force method by analyzing the previous data to recreate the signature of A
3.Chosen-Message Attack: In this method C has the knowledge about A‟s public key and obtains
A‟s signature on the messages and replaces the original message with the message C wants A to
sign with having A‟s signature on them unchanged.

5. a. Infer the concept of Elgamal Cryptography algorithm.[L2][CO3][8M]


ElGamal cryptosystem, called Elliptic Curve Variant, is based on the Discrete Logarithm
Problem. It derives the strength from the assumption that the discrete logarithms cannot be found in
practical time frame for a given number, while the inverse operation of the power can be computed
efficiently.
DESCRIPTION OF ELGAMAL ALGORITHM:
1.Key generation:
a)Select large prime number ‗p„
b)Select decryption key/private key(X)
The private key x is any number bigger than 1 and smaller than p−1.
c)Select second part of encryption key (or)public key(E1)
d)Third part of the encryption key(or) public key(E2),E2=E1 mod p
e)Public key=(E1,E2,P),private key=D
2.Encryption :
Suppose sender wishes to send a plaintext to someone whose ElGamal public key is (E1,E2,P), then
 Sender represents the plaintext as a series of numbers modulo p.To encrypt the first plaintext P,
which is represented as a number modulo p.
a)Select random integer(R)
b)C1=E1^R mod P
c)C2=(PT*E2R) mod P
d)CT=(C1,C2)
3.Decryption:
PT=[C2*(C1p)-1]mod P
 To decrypt the ciphertext (C1, C2) using private key x, the following two steps are taken –
x -x
 Compute the modular inverse of (C1) modulo p, which is (C1) , generally referred to as
decryption factor.
6.a.Examine the structure of X448 key exchange and its algorithms.[L3][CO4][7M]
X448 is an elliptic curve Diffie-Hellman key exchange using Curve448. It allows two parties to
jointly agree on a shared secret using an insecure channel.
X448 is based on Curve 448, and is used for key exchange with ECDH (Elliptic Curve Diffie
Hellman). It supports a 224-bit security level, and where we use a 448-bit (56-byte) prime number of
P=2448−2224−1. It has improved security over Curve 25519, and which has a 255-bit prime number
(P=2255−19).
Exchange Algorithm
private_key = X448PrivateKey.generate()
peer_public_key = X448PrivateKey.generate().public_key()
shared_key = private_key.exchange(peer_public_key)
Perform key derivation.
derived_key = HKDF(
... algorithm=hashes.SHA256(),
... length=32,
... salt=None,
... info=b'handshake data',
... ).derive(shared_key)
For the next handshake we MUST generate another private key.
>>> private_key_2 = X448PrivateKey.generate()
>>> peer_public_key_2 = X448PrivateKey.generate().public_key()
>>> shared_key_2 = private_key_2.exchange(peer_public_key_2)
>>> derived_key_2 = HKDF(
... algorithm=hashes.SHA256(),
... length=32,
... salt=None,
... info=b'handshake data',
... ).derive(shared_key_2)

When Bob and Alice are communicating over a network, they might want to create a unique
encryption key for each session. This is often achieved by using X448, and uses ECDH (Elliptic Curve
Diffie Hellman). With this we select a base x co-ordinate point of G, and then Bob and Alice generate
random values, and determine their public keys. Alice generates a long-term private key of a, and Bob
generates a long term private key of b. Alice‟s long public key will be:
b. Explain the concepts of Random Bit Generation.[L2][CO4][5M]
Random number generation is a process by which, often by means of a random number
generator (RNG), a sequence of numbers or symbols that cannot be reasonably predicted better than
by random chance is generated. This means that the particular outcome sequence will contain some
patterns detectable in hindsight but unpredictable to foresight.
True random number generators (TRNG), which operate by measuring a well-controlled and
specially prepared physical process. Randomness of a TRNG can be precisely, scientifically
characterized and measured. Especially valuable are the information-theoretic provable random
number generators (RNGs), which, at the state of the art, seem to be possible only by exploiting
randomness inherent to certain quantum systems.

Pseudo Random Number Generator(PRNG) refers to an algorithm that uses mathematical


formulas to produce sequences of random numbers. PRNGs generate a sequence of numbers
approximating the properties of random numbers. A PRNG starts from an arbitrary starting state
using a seed state. Many numbers are generated in a short time and can also be reproduced later,
if the starting point in the sequence is known. Hence, the numbers are deterministic and efficient.

PRF: Pseudorandom functions are not to be confused with pseudorandom generators (PRGs). The
guarantee of a PRG is that a single output appears random if the input was chosen at random.
 A PRF is an efficient (i.e. computable in polynomial time), deterministic function that maps two
distinct sets (domain and range) and looks like a truly random function.
 A PRF is considered to be good if its behavior is indistinguishable from a truly random function.
Therefore, given an output from either the truly random function or a PRF, there should be no
efficient method to correctly determine whether the output was produced by the truly random
function or the PRF.
7.Demonstrate the Structure of AES and its transformations.[L2][CO4][12M]
Advanced Encryption Standard (AES) is a specification for the encryption of electronic data
established by the U.S National Institute of Standards and Technology (NIST) in 2001. AES is
widely used today as it is a much stronger than DES and triple DES despite being harder to
implement.
 AES is a block cipher.
 The key size can be 128/192/256 bits.
 Encrypts data in blocks of 128 bits each.
That means it takes 128 bits as input and outputs 128 bits of encrypted cipher text as output. AES
relies on substitution-permutation network principle which means it is performed using a series of
linked operations which involves replacing and shuffling of the input data.
Working of the cipher:
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.
The number of rounds depends on the key length as follows :
 128 bit key – 10 rounds
 192 bit key – 12 rounds
 256 bit key – 14 rounds
Creation of Round keys:
A Key Schedule algorithm is used to calculate all the round keys from the key. So the initial key
is used to create many different round keys which will be used in the corresponding round of the
encryption.

Encryption:
AES considers each block as a 16 byte (4 byte x 4 byte = 128 ) grid in a column major
arrangement.Each round comprises of 4 steps :
 SubBytes
 ShiftRows
 MixColumns
 Add Round Key
The last round doesn‟t have the MixColumns round.
The SubBytes does the substitution and ShiftRows and MixColumns performs the permutation in
the algorithm.
SubBytes :
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.
The next two steps implement the permutation.
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.)

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.

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.
8.Discuss about key scheduling and round transformation of IDEA.[L2][CO4][12M]
In cryptography, block ciphers are very important in the designing of many cryptographic
algorithms and are widely used to encrypt the bulk of data in chunks. By chunks, it means that the
cipher takes a fixed size of the plaintext in the encryption process and generates a fixed size
ciphertext using a fixed-length key. An algorithm‟s strength is determined by its key length.
 It uses a fixed-length plaintext of 16 bits and encrypts them in 4 chunks of 4 bits each to
produce 16 bits ciphertext.
 The length of the key used is 32 bits.
 The key is also divided into 8 blocks of 4 bits each.
Rounds − There are eight round in IDEA. Each round contains a sequence of operations on the four
data blocks, utilizing six keys. The Add * and Multiply * in the following step of each round are not
easy addition and multiplication but they are addition module 216 i.e., 65536 and Multiplication
Module 216 + 1 i. e. , 65537.

This algorithm involves a series of 4 identical complete rounds and 1 half-round. Each complete
round involves a series of 14 steps that includes operations like:
 Bitwise XOR
 Addition modulo
 Multiplication modulo
Key Schedule: 6 subkeys of 4 bits out of the 8 subkeys are used in each complete round, while 4
are used in the half-round. So, 4.5 rounds require 28 subkeys. The given key, „K‟, directly gives the
first 8 subkeys. By rotating the main key left by 6 bits between each group of 8, further groups of 8
subkeys are created, implying less than one rotation per round for the key (3 rotations).

Single Round:The 16-bit plaintext can be represented as X1 || X2 || X3 || X4, each of size 4 bits.
The 32-bit key is broken into 8 subkeys denoted as K1 || K2 || K3 || K4 || K5 || K6 || K7 || K8, again
of size 4 bits each. Each round of 14 steps uses the three algebraic operation-Addition modulo
(2^4), Multiplication modulo (2^4)+1 and Bitwise XOR. The steps involved are as follows:
1. X1 * K1
2. X2 + K2
3. X3 + K3
4. X4 * K4
5. Step 1 ^ Step 3
6. Step 2 ^ Step 4
7. Step 5 * K5
8. Step 6 + Step 7
9. Step 8 * K6
10. Step 7 + Step 9
11. Step 1 ^ Step 9
12. Step 3 ^ Step 9
13. Step 2 ^ Step 10
14. Step 4 ^ Step 10
The input to the next round is Step 11 || Step 13 || Step 12 || Step 14, which becomes X1 || X2 || X3 ||
X4. This swap between 12 and 13 takes place after each complete round, except the last complete
round (4th round), where the input to the final half round is Step 11 || Step 12 || Step 13 || Step 14.
After last complete round, the output Transformation is as follows:
1. X1 * K1
2. X2 + K2
3. X3 + K3
4. X4 * K4
The final output is obtained by concatenating the blocks.
Output Transformation − It is a one-time operation. It takes place at the end of the 8th round.
Therefore 64-bit value is divided into four sub-blocks (say R1 to R4) and four subkeys are used here.

9. Evaluate the structure of blowfish algorithm and list out the merits and
Demerits.[L1][CO4][8M]
Blowfish is an encryption technique designed by Bruce Schneier in 1993 as an alternative to DES
Encryption Technique. It is significantly faster than DES and provides a good encryption rate with
no effective cryptanalysis technique found to date. It is one of the first, secure block cyphers not
subject to any patents and hence freely available for anyone to use.
1. blockSize: 64-bits
2. keySize: 32-bits to 448-bits variable size
3. number of subkeys: 18 [P-array]
4. number of rounds: 16
5. number of substitution boxes: 4 [each having 512 entries of 32-bits each]
Step1: Generation of subkeys:
 18 subkeys{P[0]…P[17]} are needed in both encryption as well as decryption process and the
same subkeys are used for both the processes.
 These 18 subkeys are stored in a P-array with each array element being a 32-bit entry.
 It is initialized with the digits of pi(?).
 The hexadecimal representation of each of the subkeys is given by:

 Now each of the subkey is changed with respect to the input key as:
P[0] = P[0] xor 1st 32-bits of input key
P[1] = P[1] xor 2nd 32-bits of input key
.
.
.
P[i] = P[i] xor (i+1)th 32-bits of input key
(roll over to 1st 32-bits depending on the key length)
.
.
.
P[17] = P[17] xor 18th 32-bits of input key
(roll over to 1st 32-bits depending on key length)
The resultant P-array holds 18 subkeys that is used during the entire encryption process
Step2: initialise Substitution Boxes:
 4 Substitution boxes(S-boxes) are needed{S[0]…S[4]} in both encryption aswell as decryption
process with each S-box having 256 entries{S[i][0]…S[i][255], 0&lei&le4} where each entry is 32-
bit.
 It is initialized with the digits of pi(?) after initializing the P-array.

Here the function “add” is addition modulo 2^32.


Step3: Encryption:
 The encryption function consists of two parts:
a. Rounds: The encryption consists of 16 rounds with each round(Ri) taking inputs the
plainText(P.T.) from previous round and corresponding subkey(Pi).
b. Post-processing: The output after the 16 rounds is processed as follows:
9.b.Derive the concepts of Stream ciphering in asymmetric key ciphers.[L3][CO4][4M]
In stream cipher, one byte is encrypted at a time while in block cipher ~128 bits are encrypted at a
time.
Initially, a key(k) will be supplied as input to pseudorandom bit generator and then it produces a
random 8-bit output which is treated as keystream.
The resulted keystream will be of size 1 byte, i.e., 8 bits.
1. Stream Cipher follows the sequence of pseudorandom number stream.
2. One of the benefits of following stream cipher is to make cryptanalysis more difficult, so the
number of bits chosen in the Keystream must be long in order to make cryptanalysis more
difficult.
3. By making the key more longer it is also safe against brute force attacks.
4. The longer the key the stronger security is achieved, preventing any attack.
5. Keystream can be designed more efficiently by including more number of 1s and 0s, for
making cryptanalysis more difficult.
6. Considerable benefit of a stream cipher is, it requires few lines of code compared to block
cipher.
Encryption :
Plain Text and Keystream produces Cipher Text (Same keystream will be used for decryption.).
 The Plaintext will undergo XOR operation with keystream bit-by-bit and produces the Cipher
Text.
Decryption :
Cipher Text and Keystream gives the original Plain Text (Same keystream will be used for
encryption.).
 The Ciphertext will undergo XOR operation with keystream bit-by-bit and produces the actual
Plain Text.
Decryption is just the reverse process of Encryption i.e. performing XOR with Cipher Text.
10. Discuss any one Asymmetric Key cipher algorithms with example. List out
the advantages and disadvantages.[L3][CO4][12M]
RSA ALGORITHM
 It is the most common public key algorithm.This RSA name is get from its inventors first letter
(Rivest (R), Shamir (S) and Adleman (A)) in the year 1977.
 The RSA scheme is a block cipher in which the plaintext & ciphertext are integers between 0 and
n-1 for some n.
 A typical size for n is 1024 bits or 309 decimal digits. That is, n is less than 2 1024
Description of the Algorithm:
RSA algorithm uses an expression with exponentials.
 In RSA plaintext is encrypted in blocks, with each block having a binary value less than some
number n. That is, the block size must be less than or equal to log2(n)
 RSA uses two exponents e and d where e public and d private.
 Encryption and decryption are of following form, for some PlainText M and CipherText block C

Both sender and receiver must know the value of n. The sender knows the value of e & only the
receiver knows the value of d thus this is a public key encryption algorithm with a Public key
PU={e, n} Private key PR={d, n}.

Steps of RSA algorithm:


Step 1→Select 2 prime numbers p & q
Step 2→Calculate n=pq
Step 3→Calculate Ø(n)=(p-1)(q-1)
Step 4→ Select or find integer e (public key) which is relatively prime to Ø(n). ie., e with gcd
(Ø(n), e)=1 where 1<e< Ø(n).
Step 5→ Calculate “d” (private key) by using following condition. d< Ø(n).
Step 6→ Perform encryption by using
Step 7→ performDecryption by using

Example:
1. Select two prime numbers, p = 17 and q = 11.
2. Calculate n = pq = 17 × 11 = 187. 3.
Calculate Ø(n) = (p - 1)(q - 1) = 16 × 10 = 160.
4. Select e such that e is relatively prime to Ø(n) = 160 and less than Ø (n); we choose e = 7.
5. Determine d such that de ≡1 (mod 160) and d < 160.The correct value is d = 23, because 23 * 7 =
161 = (1 × 160) + 1; d can be calculated using the extended Euclid‟s algorithm
6. The resulting keys are public key PU = {7, 187} and private key PR = {23, 187}.
The example shows the use of these keys for a plaintext input of M= 88. For encryption, we need to
calculate C = 887 mod 187.
Security of RSA
Four possible approaches to attacking the RSA algorithm are
• Brute force: This involves trying all possible private keys.
• Mathematical attacks: There are several approaches, all equivalent in effort to factoring the
product of two primes.
• Timing attacks: These depend on the running time of the decryption algorithm.
• Chosen ciphertext attacks: This type of attack exploits properties of the RSAalgorithm.
UNIT-IV
INTRODUCTION TO DATA SECURITY & IDS SECURITY
1. What is security attack? Explain different Types of Security attacks?[L2][CO5][12M]
Passive Attacks: Passive attacks are in the nature of eavesdropping on, or monitoring of,
transmissions. The goal of the opponent is to obtain information that is being transmitted.

Passive attacks are of two types:


Release of message contents: A telephone conversation, an e-mail message and a transferred file
may contain sensitive or confidential information.

Traffic analysis: If we had encryption protection in place, an opponent might still be able to
observe the pattern of the message. The opponent could determine the location and identity of
communication hosts and could observe the frequency and length of messages being exchanged.
This information might be useful in guessing the nature of communication that was taking place.
Passive attacks are very difficult to detect because they do not involve any alteration
of 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.

These attacks can be classified in to four categories:


Masquerade – One entity pretends to be a different entity.

Masquerade Attack
Replay – involves passive capture of a data unit and its subsequent transmission to produce an
unauthorized effect.
Repudiation – This attack occurs when the network is not completely secured or the login control
has been tampered with. With this attack, the author‟s information can be changed by actions of a
malicious user in order to save false data in log files, similar to the spoofing of e-mail messages.
Modification of messages – Some portion of message is altered or the messages are delayed or
recorded, to produce an unauthorized effect.

Denial of service – Prevents or inhibits the normal use or management of communication facilities.
Another form of service denial is the disruption of an entire network, either by disabling the
network or overloading it with messages so as to degrade performance.

2. Examine the types, process & tools of Vulnerability assessment? [L4][CO5][12M]


Vulnerability Assessment
The Information System is an integrated set of the component for collecting, storing, processing and
communicating information. All systems are prone to attacks like Cross-site
scripting(XSS) and SQL injection. This helps in identifying the vulnerabilities and weaknesses of
the system. This kind of systematic review of a system is called vulnerability assessment.
Different types of Vulnerability Assessments:
 Host Vulnerability Assessment: Applications and information systems often use servers to work
at the backend. Many attackers use these servers to inject threats in the system. Thus, it is important
to test servers and review them for vulnerability.
 Database Vulnerability Assessment: Database is one of the most important aspect of any
information system. It is where crucial user data is stored. Breach in a database system might lead
to heavy losses. Thus, it is important to make sure that any outsider can neither access the data nor
alter or destroy it. This can be done by assessing the database for possible threats and
vulnerabilities.
 Network Vulnerability Assessment: Private as well as public networks are prone to injection
attacks. Checking a network for possible issues is a better way to prevent huge losses in data.
 Application Scan Vulnerability Assessment: Most of the applications can be divided into two
parts
 The frontend
 The backend
Both of these parts have their own source code which must be statically as well as dynamically
analyzed for possible vulnerabilities. This assessment is often done through automated scans of the
source code.
Process of Vulnerability Assessment:
 Testing or Vulnerability Identification: All the aspects of a system like networks, servers, and
databases are checked for possible threats, weaknesses, and vulnerabilities. The goal of this step is
to get a list of all the possible loopholes in the security of the system. The testing is done through
machines as well as manually and all parameters are kept in mind while doing so.
 Analysis: From the first step, we get a list of vulnerabilities. Then, it is time that these are
analyzed in detail. The goal of this analysis is to identify where things went wrong so that
rectification can be done easily. This step aims at finding the root cause of vulnerabilities.
 Risk Assessment: When there are many vulnerabilities, it becomes important to classify them on
the basis of risks they might cause. The main objective of this step is to prioritize vulnerabilities on
the basis of data and systems they might affect. It also gauges the severity of attacks and the
damage they can cause.
 Rectification: Once if have a clear layout of the risks, their root cause, and their severity, we can
start making corrections in the system. The fourth step aims at closing the gaps in security by
introducing new security tools and measures.
Tools for Vulnerability Assessment:
Manually testing an application for possible vulnerabilities might be a tedious job. There are some
tools that can automatically scan the system for vulnerabilities. A few such tools include:
 Simulation tools that test web applications.
 Scanners that test network services and protocols.
 Network scanners that identify malicious packets and defects in IP addresses.
Advantages of Vulnerability Assessment:
 Detect the weakness of your system before any data breach occurs.
 A list of all possible vulnerabilities for each device present in the system.
 Record of security for future assessments.
Disadvantages of Vulnerability Assessment:
 Some advanced vulnerabilities might not be detected.
 Assessment tools might not give exact results.

3. a. Explain Vulnerability and its types?[L2][CO5][6M]


A vulnerability is a weakness in an IT system that can be exploited by an attacker to deliver a
successful attack. They can occur through flaws, features or user error, and attackers will look to
exploit any of them, often combining one or more, to achieve their end goal.
Types of Vulnerabilities:
1. Hardware Vulnerability:
A hardware vulnerability is a weakness which can used to attack the system hardware through
physically or remotely.
For examples:
1. Old version of systems or devices
2. Unprotected storage
3. Unencrypted devices, etc.
2. Software Vulnerability:
A software error happen in development or configuration such as the execution of it can violate
the security policy. For examples:
1. Lack of input validation
2. Unverified uploads
3. Cross-site scripting
4. Unencrypted data, etc.
3. Network Vulnerability:
A weakness happens in network which can be hardware or software.
For examples:
1. Unprotected communication
2. Malware or malicious software (e.g.:Viruses, Keyloggers, Worms, etc)
3. Social engineering attacks
4. Misconfigured firewalls
4. Procedural Vulnerability: A weakness happens in an organization operational methods.
For examples:
1. Password procedure – Password should follow the standard password policy.
2. Training procedure – Employees must know which actions should be taken and what to do to
handle the security. Employees must never be asked for user credentials online. Make the
employees know social engineering and phishing threats.

b. Enumerate security goals and its methods.[L1][CO5][6M]


The objective of Cyber security is to protect information from being stolen, compromised or
attacked.
1. Confidentiality
Confidentiality is roughly equivalent to privacy and avoids the unauthorized disclosure of
information. It involves the protection of data, providing access for those who are allowed to see it
while disallowing others from learning anything about its content. It prevents essential information
from reaching the wrong people while making sure that the right people can get it.

Encryption
Encryption is a method of transforming information to make it unreadable for unauthorized users by
using an algorithm. The transformation of data uses a secret key (an encryption key) so that the
transformed data can only be read by using another secret key (decryption key).
Access control
Access control defines rules and policies for limiting access to a system or to physical or virtual
resources. It is a process by which users are granted access and certain privileges to systems,
resources or information.
Authentication
An authentication is a process that ensures and confirms a user's identity or role that someone has. It
can be done in a number of different ways, but it is usually based on a combination of-
 something the person knows (like a password),
 Something the person is (like a human with a fingerprint).
Authorization
Authorization is a security mechanism which gives permission to do or have something. It is used to
determine a person or system is allowed access to resources, based on an access control policy,
including computer programs, files, services, data and application features.
Physical Security
Physical security describes measures designed to deny the unauthorized access of IT assets like
facilities, equipment, personnel, resources and other properties from damage. It protects these assets
from physical threats including theft, vandalism, fire and natural disasters.
2. Integrity
Integrity refers to the methods for ensuring that data is real, accurate and safeguarded from
unauthorized user modification. It is the property that information has not be altered in an
unauthorized way, and that source of the information is genuine.
Backups
Backup is the periodic archiving of data. It is a process of making copies of data or data files to use
in the event when the original data or data files are lost or destroyed. It is also used to make copies
for historical purposes, such as for longitudinal studies, statistics or for historical records or to meet
the requirements of a data retention policy.
Checksums
A checksum is a numerical value used to verify the integrity of a file or a data transfer. In other
words, it is the computation of a function that maps the contents of a file to a numerical value. A
checksum function depends on the entire contents of a file.
Data Correcting Codes
It is a method for storing data in such a way that small changes can be easily detected and
automatically corrected.
3. Availability
Availability is the property in which information is accessible and modifiable in a timely fashion by
those authorized to do so. It is the guarantee of reliable and constant access to our sensitive data by
authorized people.
Tools for Availability
 Physical Protections
 Computational Redundancies
Physical Protections
Physical safeguard means to keep information available even in the event of physical challenges. It
ensure sensitive information and critical information technology are housed in secure areas.
Computational redundancies
It is applied as fault tolerant against accidental faults. It protects computers and storage devices that
serve as fallbacks in the case of failures.

4. Discuss Hash Functions and Two Simple Hashing functions in detail. [L2][CO5][12M]
HASH FUNCTION
 Hashing is the process of generating a value from a text or a list of numbers using a
mathematical function known as a hash function.
 A hash function takes a string of inputs of any arbitrary size and converts them into unique
incomprehensible data of a fixed size.
 Meaning, an input data of any length will be converted into a fixed-size hash. However, if you
change input values even slightly, the output hash will be completely different.
 Values returned by a hash function are called message digest or simply hash values. The
following picture illustrated hash function −
Commonly used hash functions:
1. SHA (Secure Hash Algorithm): SHA is a family of cryptographic hash functions designed by
the National Security Agency (NSA) in the United States. The most widely used SHA algorithms
are SHA-1, SHA-2, and SHA-3.
SHA-1: SHA-1 is a 160-bit hash function that was widely used for digital signatures and other
applications. However, it is no longer considered secure due to known vulnerabilities.
 SHA-2: SHA-2 is a family of hash functions that includes SHA-224, SHA-256, SHA-384, and
SHA-512. These functions produce hash values of 224, 256, 384, and 512 bits, respectively.
SHA-3: SHA-3 is the latest member of the SHA family and was selected as the winner of the
NIST hash function competition in 2012. It is designed to be faster and more secure than SHA-2
and produces hash values of 224, 256, 384, and 512 bits.
2. CRC (Cyclic Redundancy Check): CRC is a non-cryptographic hash function used primarily
for error detection in data transmission. It is fast and efficient but is not suitable for security
purposes. The basic idea behind CRC is to append a fixed-length check value, or checksum, to the
end of a message. When the message is received, the receiver can recalculate the checksum using
the same algorithm, and compare it with the checksum transmitted with the message.
3. MurmurHash: MurmurHash is a fast and efficient non-cryptographic hash function designed
for use in hash tables and other data structures. It is not suitable for security purposes as it is
vulnerable to collision attacks.
4. BLAKE2: BLAKE2 is a cryptographic hash function designed to be fast and secure. It is an
improvement over the popular SHA-3 algorithm and is widely used in applications that require
high-speed hashing, such as cryptocurrency mining.
BLAKE2 is available in two versions: BLAKE2b and BLAKE2s. BLAKE2b is optimized for 64-
bit platforms and produces hash values of up to 512 bits, while BLAKE2s is optimized for 8 - to
32-bit platforms and produces hash values of up to 256 bits.
5. Argon2: Argon2 is a memory-hard password hashing function designed to be resistant to brute-
force attacks. It is widely used for password storage and is recommended by the Password
Hashing Competition. The main goal of Argon2 is to make it difficult for attackers to crack
passwords by using techniques such as brute force attacks or dictionary attacks.
6. MD5 (Message Digest 5): MD5 is a widely-used cryptographic hash function that produces a
128-bit hash value. It is fast and efficient but is no longer recommended for security purposes due
to known vulnerabilities. The basic idea behind MD5 is to take an input message of any length,
and produce a fixed-length output, known as the hash value or message digest. This hash value is
unique to the input message, and is generated using a mathematical algorithm that involves a
series of logical operations, such as bitwise operations, modular arithmetic, and logical functions.
Features of Hash Functions
Fixed Length Output (Hash Value)
 Hash function coverts data of arbitrary length to a fixed length. This process is often referred to
as hashing the data.
 In general, the hash is much smaller than the input data, hence hash functions are sometimes
called compression functions.
 Since a hash is a smaller representation of a larger data, it is also referred to as a digest.
 Hash function with n bit output is referred to as an n-bit hash function. Popular hash functions
generate values between 160 and 512 bits.
TWO SIMPLE HASH FUNCTIONS
To get some feel for the security considerations involved in cryptographic hash functions, we
present two simple, insecure hash functions in this section. All hash functions operate using the
following general principles. The input (message, file, etc.) is viewed as a sequence of n-bit
blocks. The input is processed one block at a time in an iterative fashion to produce an n-
bit hash function.One of the simplest hash functions is the bit-by-bit exclusive-OR (XOR) of every
block. This can be expressed as

This operation produces a simple parity for each bit position and is known as a longitudinal
redundancy check. It is reasonably effective for random data as a data integrity check. Each n-bit
hash value is equally likely. Thus, the probability that a data error will result in
an unchanged hash value is 2-n. With more predictably formatted
data, the function is less effective. For example, in most normal text files, the high-order bit
of each octet is always zero. So if a 128-bit hash value is used, instead of an effectiveness of 2-
128, the hash function on this type of data has an effectiveness of 2-112.
A simple way to improve matters is to perform a one-bit circular shift is processed.
The procedure can be summa- rized as follows.
1. Initially set the n-bit hash value to zero.
2. Process each successive n-bit block of data as follows:
a. Rotate the current hash value to the left by one bit.
b. XOR the block into the hash value.
This has the effect of “randomizing” the input more completely and overcoming any regularities that
appear in the input.

Given a message, it is an easy matter to produce a new message that yields that hash code: Simply
prepare the desired alternate message and then append an n- bit block that forces the new
message plus block to yield the desired hash code.
Although a simple XOR rotated XOR (RXOR) is insufficient if only the hash
code is encrypted, you may still feel that such a simple function could be useful
when the message together with the hash code is encrypted But you must be careful. A technique
originally proposed by the National Bureau of Standards used the simple XOR applied to 64-bit
blocks of the message and then an encryption of the entire message that used
the cipher block chaining (CBC) mode. Given a message M consisting of a sequence of 64-bit
blocks X1, X2, Á , XN, define the hash code h = H(M) as
the block-by-block XOR of all blocks and append the hash code as the final block:
h = XN+1 = X1 Ⓧ X2 Ⓧ Á Ⓧ XN
Next, encrypt the entire message plus hash code using CBC mode to produce the
encrypted message Y1, Y2, ..... , YN+1.
Because the terms in the preceding equation can be XORed in any order, it follows
that the hash code would not change if the ciphertext blocks were permuted.
5. Design elliptic curve architecture and its functions briefly.[L6][CO5][12M]
Elliptical curve cryptography (ECC) is a public key encryption technique based on
elliptic curve theory that can be used to create faster, smaller and more efficient cryptographic
keys.
ECC is thought to be highly secure if the key size used is large enough. The U.S. government
requires the use of ECC with a key size of either 256 or 384 bits for internal communications,
depending on the sensitivity level of the information being transmitted.
ECC is an alternative to the Rivest-Shamir-Adleman (RSA) cryptographic algorithm
and is most often used for digital signatures in cryptocurrencies, such as Bitcoin and Ethereum, as
well as one-way encryption of emails, data and software.
 Each of these cryptography mechanisms uses the concept of a one-way, or trapdoor, function.
 But ECC is not necessarily any more or less secure compared to alternatives such as RSA.
 The primary benefit of ECC is the inherent efficiencies gained when encrypting and decrypting
data.
 An elliptic curve is not an ellipse, or oval shape, but it is represented as a looping line
intersecting two axes, which are lines on a graph used to indicate the position of a point. The
curve is completely symmetric, or mirrored, along the x-axis of the graph.
Elliptic Curve Cryptography (ECC) is an approach to public-key cryptography, based
on the algebraic structure of elliptic curves over finite fields. ECC requires a smaller key as
compared to non-ECC cryptography to provide equivalent security (a 256-bit ECC security has
equivalent security attained by 3072-bit RSA cryptography).
For a better understanding of Elliptic Curve Cryptography, it is very important to
understand the basics of the Elliptic Curve. An elliptic curve is a planar algebraic curve defined
by an equation of the form

Where „a‟ is the co-efficient of x and „b‟ is the constant of the equation
The curve is non-singular; that is, its graph has no cusps or self-intersections (when the
characteristic of the Coefficient field is equal to 2 or 3).
In general, an elliptic curve looks like as shown below. Elliptic curves can intersect almost 3
points when a straight line is drawn intersecting the curve. As we can see, the elliptic curve is
symmetric about the x-axis. This property plays a key role in the algorithm.

ECC is like most other public key encryption methods, such as the RSA algorithm and Diffie-
Hellman. Each of these cryptography mechanisms uses the concept of a one-way, or trapdoor,
function. This means that a mathematical equation with a public and private key can be used to
easily get from point A to point B. But, without knowing the private key and depending on the key
size used, getting from B to A is difficult, if not impossible, to achieve.
Uses
 Websites make extensive use of ECC to secure customers„ hypertext transfer protocol connections.
 It is used for encryption by combining the key agreement with a symmetric encryption scheme.
 It is also used in several integer factorization algorithms like Lenstra elliptic-curve factorization.
 Time stamping uses an encryption model called a blind signature scheme. It is possible using Elliptic
Curve Cryptography.

6.a.Define Non-malicious Program errors and identify Buffer overflow in Non-


malicious Program errors.[L3][CO5][7M]
NONMALICIOUS PROGRAM ERRORS
It is simply called as non-intentional errors.Being human, programmers and other developers make
many mistakes, most of which are unintentional and non-malicious. Many such errors cause
program malfunctions but do not lead to more serious security vulnerabilities.
Buffer Overflow
Also known as a buffer overrun, buffer overflow occurs when the amount of data in the buffer
exceeds its storage capacity. That extra data overflows into adjacent memory locations and corrupts
or overwrites the data in those locations. Buffer overflow is a software coding error or vulnerability
that can be exploited by hackers to gain unauthorized access to corporate systems
Buffer Overflow Attack
A buffer overflow attack takes place when an attacker manipulates the coding error to carry out
malicious actions and compromise the affected system. The attacker alters the application‟s
execution path and overwrites elements of its memory, which amends the program‟s execution path
to damage existing files or expose data.
A buffer overflow vulnerability will typically occur when code:
1. Is reliant on external data to control its behavior
2. Is dependent on data properties that are enforced beyond its immediate scope
3. Is so complex that programmers are not able to predict its behavior accurately
Buffer Overflow Consequences
1. System crashes: A buffer overflow attack will typically lead to the system crashing. It may also
result in a lack of availability and programs being put into an infinite loop.
2. Access control loss: A buffer overflow attack will often involve the use of arbitrary code, which
is often outside the scope of programs‟ security policies.
3. Further security issues: When a buffer overflow attack results in arbitrary code execution, the
attacker may use it to exploit other vulnerabilities and subvert other security services.
Types of Buffer Overflow Attacks
1. Stack-based buffer overflows: This is the most common form of buffer overflow attack. The
stack-based approach occurs when an attacker sends data containing malicious code to an
application, which stores the data in a stack buffer. This overwrites the data on the stack, including
its return pointer, which hands control of transfers to the attacker.
2. Heap-based buffer overflows: A heap-based attack is more difficult to carry out than the stack-
based approach. It involves the attack flooding a program‟s memory space beyond the memory it
uses for current runtime operations.
3. Format string attack: A format string exploit takes place when an application processes input
data as a command or does not validate input data effectively. This enables the attacker to execute
code, read data in the stack, or cause segmentation faults in the application. This could trigger new
actions that threaten the security and stability of the system.
4. Integer Overflow Attack
An integer overflow attack occurs due to the arithmetic overflow error, in which the result of an
integer function does not lie in the allocated area in the memory. Rather than a program error, it
generally results in an unexpected result.Most integer overflow conditions can lead to inaccurate
program behavior without causing any vulnerabilities.
5. Unicode Overflow
Unicode strings are created to ensure that all languages from each country can be used without
transcription issues. For instance, Arabic characters are different from English characters. Such
characters could not be converted based on the ASCII codes. The format string attack occurs when
an application does not validate input data efficiently. It allows hackers to execute code and cause
segmentation faults in an application.

6.b. Evaluate the types and characteristics of Data Integrity.[L5][CO5][5M]


Types of data integrity
Physical integrity
Physical integrity is the protection of the completeness and accuracy of that data as it‟s stored,
maintained in storage, and retrieved. When natural disasters strike, the power goes out, or a disk
drive crashes, the physical integrity of data is compromised. Human error, storage erosion, and a
host of other issues can also make it impossible for data processing managers, system programmers,
applications programmers, and internal auditors to obtain accurate data.
Logical integrity
Logical integrity keeps data unchanged as it‟s used in different ways in a relational database.
Logical integrity protects data from human error and hackers as well, but in a much different way
than physical integrity does.
There are four types of logical integrity:
• Entity integrity: Entity integrity relies on the creation of primary keys the unique values that
identify pieces of data to ensure that data isn‟t listed more than once and that no field in a table is
null.
• Referential integrity: Referential integrity refers to the series of processes that make sure data is
stored and used uniformly. Rules embedded into the database‟s structure about how foreign keys
are used ensure that only appropriate changes, additions, or deletions of data occur.
• Domain integrity: Domain integrity is the collection of processes that ensure the accuracy of
each piece of data in a domain. In this context, a domain is a set of acceptable values that a column
is allowed to contain.
• User-defined integrity: User-defined integrity involves the rules and constraints created by the
user to fit their particular needs. Sometimes entity, referential, and domain integrity aren‟t enough
to safeguard data.
Data integrity characteristics
• Completeness. To what degree is the data fully available in the database.
• Accuracy. Is the data in the right form and is it correct and true.
• Consistency. Consistency of data can be low level (i.e., customer contact info is formatted in the
same way) or high level (different groups are using the same dataset).
• Timeliness. How near to real-time is the data being collected? Old data is often not useful.
• Compliance. Does the data meet compliance standards, such as data privacy regulations and other
regulations.

7.a.Infer in detail about Time-of-check to Time-of-use Errors.[L2][CO5][6M]


TIME-OF-CHECK TO TIME-OF USE ERRORS
Time-of-check-to-time-of-use (TOCTTOU-pronounced TOCK-too) is a file-based race
condition that occurs when a resource is checked for a particular value, such as whether a file exists
or not, and that value then changes before the resource is used, invalidating the results of the check.
Race Condition Vulnerability
Race condition occurs when multiple threads read and write the same variable i.e. they have access
to some shared data and they try to change it at the same time. In such a scenario threads are
“racing” each other to access/change the data.This vulnerability arises during a TOCTOU (time-of-
check, time-of-use) window.

Flow of File Access during it’s TOCTOU Window


If we lock the file during this TOCTOU window the following things will happen
1. General Misconception
A trivial cure to this vulnerability could be locking the file itself during this check-and-use window,
because then no other process can use the file during the time window.
2. Problems while locking the file
 A file is locked out for other processes only if it is already in open state. This process is called
check-and-open process and during this time it is impossible to lock a file. Any locks created can
be ignored by the attacking or the malicious process.
 When the file is available for a check-and-open process, the file actually is open to any access/
change. So it‟s impossible to lock a file at this point of time. This makes any kind of locks
virtually non-existent to the malicious processes.
3. What would happen even if we were somehow able to lock the file?
The most common locking mechanism that is available is atomic file locking. It is done using a
lockfile to create a unique file on the same filesystem. We make use of link() to make a link to the
lockfile for any kind of access to the file.
If link() returns 0, the lock is successful.
4. Actual Solutions
A better solution is to rather than creating locks on the file as a whole, lock the parts of the file to
different processes.
Example –
When a process wants to write into a file, it first asks the kernel to lock that file or a part of it. As
long as the process keeps the lock, no other process can ask to lock the same part of the file. In the
same way, a process asks for locking before reading the content of a file, which ensures no changes
will be made as long as the lock is kept.
This kind of locking system is achieved by the flock() system call. Flock() call can have different
values :
 LOCK_SH (lock for reading)
 LOCK_EX (for writing)
 LOCK_UN (release of the lock)
Using these separate call we can tell what kind of locks are necessary.
A point to note here is that, many processes can be benefited from a reading lock simultaneously
since no one will attempt to change the file content. However, only one process can benefit from a
lock for writing at a given time which is currently using it. Thus no other lock can be allowed at the
same time, even for reading.
b.Describe Hash funtions.List out the features and properties of hash
functions.[L2][CO5][6M]
 A hash function takes a string of inputs of any arbitrary size and converts them into unique
incomprehensible data of a fixed size.
 Meaning, an input data of any length will be converted into a fixed-size hash. However, if you
change input values even slightly, the output hash will be completely different.
 Values returned by a hash function are called message digest or simply hash values. The
following picture illustrated hash function −

Features of Hash Functions


Fixed Length Output (Hash Value)
 Hash function coverts data of arbitrary length to a fixed length. This process is often referred to
as hashing the data.
 In general, the hash is much smaller than the input data, hence hash functions are sometimes
called compression functions.
 Since a hash is a smaller representation of a larger data, it is also referred to as a digest.
 Hash function with n bit output is referred to as an n-bit hash function. Popular hash functions
generate values between 160 and 512 bits.
Properties of Hash Functions
In order to be an effective cryptographic tool, the hash function is desired to possess following properties −
 Pre-Image Resistance
o This property means that it should be computationally hard to reverse a hash function.
o In other words, if a hash function h produced a hash value z, then it should be a difficult process
to find any input value x that hashes to z.
o This property protects against an attacker who only has a hash value and is trying to find the
input.
 Second Pre-Image Resistance
o This property means given an input and its hash, it should be hard to find a different input with
the same hash.
o In other words, if a hash function h for an input x produces hash value h(x), then it should be
difficult to find any other input value y such that h(y) = h(x).
o This property of hash function protects against an attacker who has an input value and its hash,
and wants to substitute different value as legitimate value in place of original input value.
 Collision Resistance
o This property means it should be hard to find two different inputs of any length that result in the
same hash. This property is also referred to as collision free hash function.
o In other words, for a hash function h, it is hard to find any two different inputs x and y such that
h(x) = h(y).
o Since, hash function is compressing function with fixed hash length, it is impossible for a hash
function not to have collisions. This property of collision free only confirms that these collisions
should be hard to find.
o This property makes it very difficult for an attacker to find two input values with the same hash.
o Also, if a hash function is collision-resistant then it is second pre-image resistant.
8.Classify various types of viruses in IDS Security. [L4][CO5][12M]
A virus is a fragment of code embedded in a legitimate program. Viruses are self-replicating and are
designed to infect other programs. They can wreak havoc in a system by modifying or destroying files
causing system crashes and program malfunctions.
Various types of viruses:
 File Virus:
This type of virus infects the system by appending itself to the end of a file. It changes the start of a
program so that the control jumps to its code. After the execution of its code, the control returns back
to the main program. Its execution is not even noticed. It is also called a Parasitic virus because it
leaves no file intact but also leaves the host functional.
 Boot sector Virus:
It infects the boot sector of the system, executing every time system is booted and before the
operating system is loaded. It infects other bootable media like floppy disks. These are also known as
memory viruses as they do not infect the file systems.

 Macro Virus:
Unlike most viruses which are written in a low-level language(like C or assembly language), these are
written in a high-level language like Visual Basic. These viruses are triggered when a
program capable of executing a macro is run. For example, the macro viruses can be contained in
spreadsheet files.
 Source code Virus:
It looks for source code and modifies it to include virus and to help spread it.
 Polymorphic Virus:
A virus signature is a pattern that can identify a virus(a series of bytes that make up virus code). So
in order to avoid detection by antivirus a polymorphic virus changes each time it is installed. The
functionality of the virus remains the same but its signature is changed.
 Encrypted Virus:
In order to avoid detection by antivirus, this type of virus exists in encrypted form. It carries a
decryption algorithm along with it. So the virus first decrypts and then executes.
 Stealth Virus:
It is a very tricky virus as it changes the code that can be used to detect it. Hence, the detection of
viruses becomes very difficult. For example, it can change the read system call
such that whenever the user asks to read a code modified by a virus, the original form of code is
shown rather than infected code.
 Tunneling Virus:
This virus attempts to bypass detection by antivirus scanner by installing itself in the interrupt handler
chain. Interception programs, which remain in the background of an operating system and catch
viruses, become disabled during the course of a tunneling virus. Similar viruses install themselves in
device drivers.
 Multipartite Virus:
This type of virus is able to infect multiple parts of a system including the boot sector, memory, and
files. This makes it difficult to detect and contain.
 Armored Virus:
An armored virus is coded to make it difficult for antivirus to unravel and understand. It uses a variety
of techniques to do so like fooling antivirus to believe that it lies somewhere else than its real location
or using compression to complicate its code.
 Browser Hijacker:
As the name suggests this virus is coded to target the user„s browser and can alter the browser
settings. It is also called the browser redirect virus because it redirects your browser to other
malicious sites that can harm your computer system.
 Resident Virus:
Resident viruses installation store for your RAM and meddle together along with your device
operations. They„re so sneaky that they could even connect themselves for your anti-virus software
program files.

9.a.Define firewall? Examine the need for firewalls and role of firewalls in
protecting networks.[L4][CO5][8M]
A firewall can be defined as a special type of network security device or a software program
that monitors and filters incoming and outgoing network traffic based on a defined set of security rules.
It acts as a barrier between internal private networks and external sources (such as the public Internet).
 The primary purpose of a firewall is to allow non-threatening traffic and prevent malicious or
unwanted data traffic for protecting the computer from viruses and attacks.
 A firewall is a cybersecurity tool that filters network traffic and helps users block malicious
software from accessing the Internet in infected computers.
 A firewall system analyzes network traffic based on pre-defined rules. It then filters the traffic and
prevents any such traffic coming from unreliable or suspicious sources.

Functions of Firewall
As stated above, the firewall works as a gatekeeper. It analyzes every attempt coming to gain access to
our operating system and prevents traffic from unwanted or non-recognized sources.
Since the firewall acts as a barrier or filter between the computer system and other networks (i.e., the
public Internet), we can consider it as a traffic controller. Therefore, a firewall's primary function is to
secure our network and information by controlling network traffic, preventing unwanted incoming
network traffic, and validating access by assessing network traffic for malicious things such as hackers
and malware.
Generally, most operating systems (for example - Windows OS) and security software come with
built-in firewall support. Therefore, it is a good idea to ensure that those options are turned on.
Additionally, we can configure the security settings of the system to be automatically updated
whenever available.
Firewall built-in features:
 Network Threat Prevention
 Application and Identity-Based Control
 Hybrid Cloud Support

Scalable Performance
 Network Traffic Management and Control
 Access Validation
 Record and Report on Events
Limitations of Firewall
 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.
Types of Firewall
 Proxy Firewall
 Packet-filtering firewalls
 Stateful Multi-layer Inspection (SMLI) Firewall
 Unified threat management (UTM) firewall
 Next-generation firewall (NGFW)
 Network address translation (NAT) firewalls

b.Summarize
(i) Salami attack. [L2][CO5][4M]
A salami attack is a method of cybercrime that attackers or a hacker typically used to commit
financial crimes. Cybercriminals steal money or resources from financial accounts on a system one
at a time. This attack occurs when several minor attacks combine to create a sturdy attack. Salami
attacks are used for the commission of economic crimes.
Working of Salami attack
During this kind of attack, an awfully insignificant change is introduced that goes completely
unnoticed. As an example, a bank accountant inserts a program, into the bank‟s servers, that deducts
a satiny low amount of cash from the account of each customer. No account holder will probably
notice this unauthorized debit, but the bank accountant will make an outsized amount of cash each
month.
Types of Salami attacks:
 Salami Slicing: Salami Slicing occurs when the attackers/hacker get customer information, like
Bank/credit card details and other similar sort of detail by using an online database the
attacker/hacker deduct an awfully touch of cash from each account and these amounts add up to an
oversized amount of cash and this can be often invisibly to deduct such amount. Because the
amount is tiny. As an example, suppose an attacker/hacker withdraws ₹0.0001 from each checking
account.
 Penny Shaving: when the attackers/hacker steal money in small amounts. By using rounding to the
closest within the transactions. so, change is so small so, nobody can detect such dough in a single
transaction
(ii) Trap Door
 The trap door is also known as the back door. In which, the Programmer designs a security or
secret code that gives a threat to the system.
 The trap door program threat is one in which the designer keeps a hole in the program, so it can
be handled only by the designer. So, it is very difficult to track or find the hole in the program
and need to go through the entire source code.
 This security hole helps the designer access that system. When the system is in an abnormal
state, if we take data backup it also contains hidden threats.
Attacks
The attacks by trap doors have impacted hundreds and thousands of systems to the threat. Even the
companies like Google and Microsoft have been a target to trap doors.

10. Illustrate various types of malicious software viruses.[L3][CO5][12M]


Any malicious software intended to harm or exploit any programmable device, service, or network
is referred to as malware. Cybercriminals typically use it to extract data they can use against victims
to their advantage in order to profit financially.
TYPES OF MALWARE
1. Viruses – A Virus is a malicious executable code attached to another executable file. The virus
spreads when an infected file is passed from system to system. Viruses can be harmless or they
can modify or delete data. Opening a file can trigger a virus. Once a program virus is active, it
will infect other programs on the computer.
2. Worms – Worms replicate themselves on the system, attaching themselves to different files and
looking for pathways between computers, such as computer network that shares common file
storage areas. Worms usually slow down networks. A virus needs a host program to run but
worms can run by themselves. After a worm affects a host, it is able to spread very quickly over
the network.
3. Trojan horse – A Trojan horse is malware that carries out malicious operations under the
appearance of a desired operation such as playing an online game. A Trojan horse varies from a
virus because the Trojan binds itself to non-executable files, such as image files, and audio files.
4. Ransomware – Ransomware grasps a computer system or the data it contains until the victim
makes a payment. Ransomware encrypts data in the computer with a key that is unknown to the
user. The user has to pay a ransom (price) to the criminals to retrieve data. Once the amoun t is
paid the victim can resume using his/her system
5. Adware – It displays unwanted ads and pop-ups on the computer. It comes along with software
downloads and packages. It generates revenue for the software distributer by displaying ads.
6. Spyware – Its purpose is to steal private information from a computer system for a third party.
Spyware collects information and sends it to the hacker.
7. Logic Bombs – A logic bomb is a malicious program that uses a trigger to activate the malicious
code. The logic bomb remains non-functioning until that trigger event happens. Once triggered, a
logic bomb implements a malicious code that causes harm to a computer. Cybersecurity
specialists recently discovered logic bombs that attack and destroy the hardware components in a
workstation or server including the cooling fans, hard drives, and power supplies. The logic bomb
overdrives these devices until they overheat or fail.
8. Rootkits – A rootkit modifies the OS to make a backdoor. Attackers then use the backdoor to
access the computer distantly. Most rootkits take advantage of software vulnerabilities to modify
system files.
9. Backdoors – A backdoor bypasses the usual authentication used to access a system. The purpose
of the backdoor is to grant cyber criminals future access to the system even if the organization
fixes the original vulnerability used to attack the system.
10. Keyloggers – Keylogger records everything the user types on his/her computer system to obtain
passwords and other sensitive information and send them to the source of the keylogging
program.
UNIT-V
IP SECURITY & DIGITA SIGNATURES
1.Sketch neatly and summarize IP security Architecture in detail.[L3][CO6][12M]
IPSec (IP Security) architecture uses two protocols to secure the traffic or data flow. These protocols
are ESP (Encapsulation Security Payload) and AH (Authentication Header). IPSec Architecture
includes protocols, algorithms, DOI, and Key Management. All these components are very important in
order to provide the three main services:
 Confidentiality
 Authentication
 Integrity

1. Architecture: Architecture or IP Security Architecture covers the general concepts,


definitions, protocols, algorithms, and security requirements of IP Security technology.
2. ESP Protocol: ESP(Encapsulation Security Payload) provides a confidentiality service.
Encapsulation Security Payload is implemented in either two ways:
 ESP with optional Authentication.
 ESP with Authentication.
Packet Format:

Security Parameter Index(SPI): This parameter is used by Security Association. It is used to


give a unique number to the connection built between the Client and Server.
Sequence Number: Unique Sequence numbers are allotted to every packet so that on the receiver
side packets can be arranged properly.
Payload Data: Payload data means the actual data or the actual message. The Payload data is in
an encrypted format to achieve confidentiality.
Padding: Extra bits of space are added to the original message in order to ensure confidentiality.
Padding length is the size of the added bits of space in the original message.
Next Header: Next header means the next payload or next actual data.
Authentication Data This field is optional in ESP protocol packet format.
3. Encryption algorithm: The encryption algorithm is the document that describes various
encryption algorithms used for Encapsulation Security Payload.
4. AH Protocol: AH (Authentication Header) Protocol provides both Authentication and Integrity
service. Authentication Header is implemented in one way only: Authentication along with
Integrity.
5. Authentication Algorithm: The authentication Algorithm contains the set of documents that
describe the authentication algorithm used for AH and for the authentication option of ESP.
6. DOI (Domain of Interpretation): DOI is the identifier that supports both AH and ESP
protocols. It contains values needed for documentation related to each other.
7. Key Management: Key Management contains the document that describes how the keys are
exchanged between sender and receiver.
Characteristics Associated with IPSec:
1. The standardized algorithms present in IP Sec are SHA and MD5.
2. IPSec uniquely identifies every packet, and then authentication is carried out based on verifying the
same uniqueness of the packet.
3. IP network or IPSec has an ESP present in it for security purposes.

2.Generalize Authentication header and its modes of operation in detail.[L6][CO6][12M]


AH ensures that your data has not been tampered with en route to its final destination. Although AH
authenticates as much of the IP datagram as possible, the values of certain fields in the IP header
cannot be predicted by the receiver.
When packet is sent from source A to Destination B, it consists of data that we need
to send and header which consist of information regarding packet. Authentication Header verifies
origin of data and also payload to confirm if there has been modification done in between, during
transmission between source and destination. However, in transit, values of some IP header fields
might change (like- Hop count, options, extension headers). So, values of such fields cannot be
protected from Authentication header.
Authentication header cannot protect every field of IP header. It provides protection to fields
which are essential to be protected.
There are two main advantages that Authentication Header provides,
 Message Integrity – It means, message is not modified while coming from the source.
 Source Authentication – It means, the source is exactly the source from whom we were
expecting data.
Authentication Header: The question may arise, that how IP header will know that adjacent
Extension header is Authentication Header. There is protocol field in IP Header which tells type
of header that is present in packet. So, protocol field in IP Header should have value of “51” in
order to detect Authentication Header.
1. Next Header – Next Header is 8-bit field that identifies type of header present after
Authentication Header. In case of TCP, UDP or destination header or some other extension
header it will store correspondence IP protocol number . Like, number 4 in this field will indicate
IPv4, number 41 will indicate IPv6 and number 6 will indicate TCP.
2. Payload Length – Payload length is length of Authentication header and here we use scaling
factor of 4. We are not including Next Header, Payload length, Reserved and Security Parameter
index in calculating payload length. Like, say if payload length is given to be X. Then (X+2)*4
will be original Authentication header length.
3. Reserved – This is 16-bit field which is set to “zero” by sender as this field is reserved for future
use.
4. Security Parameter Index (SPI) – It is arbitrary 32-bit field. It is very important field which
identifies all packets which belongs to present connection. If we‟re sending data from Source A to
Destination B. Both A and B will already know algorithm and key they are going to use. Secret
key between A and B is exchanged by method of Diffie Hellman algorithm. In Security
Association, both parties needs to communicate prior to data exchange.
5. Sequence Number – This unsigned 32-bit field contains counter value that increases by one for
each packet sent. Every packet will need sequence number. It will start from 0 and will go till – 1
and there will be no wrap around. Say, if all sequence numbers are over and none of it is left but
we cannot wrap around as it is not allowed. So, we will end connection and re-establish
connection again to resume transfer of remaining data from sequence number 0. Basically
sequence numbers are used to stop replay attack.
6. Authentication Data (Integrity Check Value) – Authentication data is variable length field that
contains Integrity Check Value (ICV) for packet. Using hashing algorithm and secret key, sender
will create message digest which will be sent to receiver. Receiver on other hand will use same
hashing algorithm and secret key. If both message digest matches then receiver will accept data.
Otherwise, receiver will discard it by saying that message has been modified in between.
7. Modes of operations in Authentication Header:
There are two modes in the authentication header
 Authentication Header Transport Mode:
 Authentication Header Tunnel Mode:
1. Authentication Header Transport Mode: In the authentication header transport mode, it is lies
between the original IP Header and IP Packets original TCP header.
2. Authentication Header Tunnel Mode: In this authentication header tunnel mode, the original
IP packet is authenticated entire and the authentication header is inserted between the original IP
header and new outer IP header. Here, the inner IP header contains the ultimate source IP
address and destination IP address. whereas the outer IP header contains different IP
address that is IP address of the firewalls or other security gateways.

3.a.Justify briefly about combining Security Associations.[L5][CO6][8M]


COMBINING SECURITY ASSOCIATIONS
An individual SA can implement either the AH or ESP protocol but not both. Sometimes a
particular traffic flow will call for the services provided by both AH and ESP.
SA‟s can implement either AH or ESP
• To implement both need to combine SA‟s – form a security association bundle – may terminate at
different or same endpoints.
Security associations may be combined into bundles in two ways:
Transport adjacency: Refers to applying more than one security protocol to the same IP packet
without invoking tunneling. This approach to combining AH and ESP allows for only one level of
combination; further nesting yields no added benefit since the processing is performed at one IPsec
instance: the (ultimate) destination.
Iterated tunneling: Refers to the application of multiple layers of security protocols effected
through IP tunneling. This approach allows for multiple levels of nesting, since each tunnel can
originate or terminate at a different IPsec site along the path.

Each SA can be either AH or ESP. For host-to-host SAs, the mode may be either transport or
tunnel; otherwise it must be tunnel mode.
Case1. All security is provided between end systems that implement
IPsec. For any two end systems to communicate via an SA, they must share the appropriate secret
keys. Among the possible combinations are
a. AH in transport mode
b. ESP in transport mode
c. ESP followed by AH in transport mode (an ESP SA inside an AH SA)
d.Any one of a, b, or c inside an AH or ESP in tunnel mode
Case 2. Security is provided only between gateways (routers, firewalls, etc.) and no hosts
implement IPsec. The security architecture document specifies that only a single tunnel SA is needed
for this case. The tunnel could support AH, ESP, or ESP with the authenti- cation option. Nested
tunnels are not required, because the IPsec services apply to the entire inner packet.
Case 3. This builds on case 2 by adding end-to-end security. The same combi- nations discussed for
cases 1 and 2 are allowed here. The gateway-to-gateway tunnel provides either authentication,
confidentiality, or both for all traffic between end systems. When the gateway-to-gateway tunnel is
ESP, it also provides a limited form of traffic confidentiality.
Case 4. This provides support for a remote host that uses the Internet to reach an organization‟s firewall
and then to gain access to some server or workstation
behind the firewall. Only tunnel mode is required between the remote host and the firewall.As
in case 1, one or two SAs may be used between the remote host and the local host.

b.Distinguish between Digital Signature and Digital Certificate.[L4][CO6][4M]


Feature Digital Signature Digital Certificate
Digital signature is like a fingerprint or Digital certificate is a file that
Basics / Definition an attachment to a digital document that ensures holder‟s identity and
ensures its authenticity and integrity. provides security.
Hashed value of original message is It is generated by CA (Certifying
encrypted with sender‟s secret key to Authority) that involves four steps:
Process / Steps
generate the digital signature. Key Generation, Registration,
Verification, Creation.
Authenticity of Sender, integrity of the It provides security
Security Services document and non-repudiation. and authenticity of certificate
holder.
It follows Digital Signature Standard It follows X.509 Standard Format
Standard
(DSS).

4.Infer the characteristics, working and components of Encapsulating security


payloads.[L2][CO6][12M]
Encapsulation security payload, also abbreviated as ESP plays a very important role in network
security. ESP or Encapsulation security payload is an individual protocol in IPSec. ESP is
responsible for the CIA triad of security (Confidentiality, Integrity, Availability), which is
considered significant only when encryption is carried along with them. Securing all payload/
packets/ content in IPv4 and IPv6 is the responsibility of ESP.
Encryption/ encapsulation and security/ authentication make the payload extremely secure
and safe from any kind of harm or threat to content/ data/ payload being stolen by any third party.
The encryption process is performed by authenticated user, similarly, the decryption process is
carried out only when the receiver is verified, thus making the entire process very smooth and
secure.
Working of ESP:
1. Encapsulating Security Payload supports both main Transport layer protocols: IPv4 and IPv6
protocols.
2. It performs the functioning of encryption in headers of Internet Protocol or in general say, it resides
and performs functions in IP Header.
3. One important thing to note here is that the insertion of ESP is between Internet Protocol and other
protocols such as UDP/ TCP/ ICMP.
Modes in ESP:
Encapsulating Security Payload supports two modes, i.e. Transport mode, and tunnel mode.
Tunnel mode:
1. Mandatory in Gateway, tunnel mode holds utmost importance.
2. Here, a new IP Header is created which is used as the outer IP Header followed by ESP.
Transport mode:
1. Here, IP Header is not protected via encryption or authentication, making it vulnerable to threats
2. Less processing is seen in this mode, so the inclusion of ESP is preferred
Advantages:
1. Encrypting data to provide security
2. Maintaining a secure gateway for data/ message transmission
3. Properly authenticating the origin of data
4. Providing needed data integrity
5. Maintaining data confidentiality
6. Helping with antireplay service using authentication header
Disadvantages:
1. There is a restriction on the encryption method to be used
2. For global use and implementation, weaker encryptions are mandatory to use
Components of ESP:
An important point to note is that authentication and security are not provided for the entire IP
packet in transport mode. On the other hand for the tunnel mode, the entire IP packet along with the
new packet header is encapsulated.
ESP Structure
1. Security Parameter :
 Security parameters are assigned a size of 32 bits for use
 Security Parameter is mandatory to security parameter in ESP for security links and associations
2. Sequence Number:
 The sequence number is 32 bits in size and works as an incremental counter.
 The first packet has a sequence number 1 assigned to it whenever sent through SA
3. Payload Data:
 Payload data don‟t have fixed size and are variable in size to use
 It refers to the data/ content that is provided security by the method of encryption
4. Padding:
 Padding has an assigned size of 0-255 bytes assigned to it.
 Padding is done to ensure that the payload data which needs to be sent securely fits into the cipher
block correctly, so for this padding payloads come to the rescue.
5. Pad Length:
 Pad Length is assigned the size of 8 bits to use
 It is a measure of pad bytes that are preceding
6. Next Header:
 The next header is associated with a size of 8 bits to use
 It is responsible for determining the data type of payload by studying the first header of the payload
7. Authentication Data:
 The size associated with authentication data is variable and never fixed for use-case
 Authentication data is an optional field that is applicable only when SA is selected. It serves the
purpose of providing integrity

5.a. Discuss Model of Digital Signature and Encryption with Digital


Signature.[L2][CO6][6M]
As mentioned earlier, the digital signature scheme is based on public key cryptography. The model of digital
signature scheme is depicted in the following illustration −
The following points explain the entire process in detail −
 Each person adopting this scheme has a public-private key pair.
 Generally, the key pairs used for encryption/decryption and signing/verifying are different. The private
key used for signing is referred to as the signature key and the public key as the verification key.
 Signer feeds data to the hash function and generates hash of data.
 Hash value and signature key are then fed to the signature algorithm which produces the digital signature
on given hash. Signature is appended to the data and then both are sent to the verifier.
 Verifier feeds the digital signature and the verification key into the verification algorithm. The
verification algorithm gives some value as output.
 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.
Encryption with Digital Signature
In many digital communications, it is desirable to exchange an encrypted messages than plaintext to
achieve confidentiality. In public key encryption scheme, a public (encryption) key of sender is
available in open domain, and hence anyone can spoof his identity and send any encrypted message to
the receiver.
This makes it essential for users employing PKC for encryption to seek digital signatures along with
encrypted data to be assured of message authentication and non-repudiation.
This can archived by combining digital signatures with encryption scheme. Let us briefly discuss how to
achieve this requirement.
There are two possibilities, sign-then-encrypt and encrypt-then-sign.

The receiver after receiving the encrypted data and signature on it, first verifies the signature using sender‟s
public key. After ensuring the validity of the signature, he then retrieves the data through decryption using his
private key.

b. Differentiate between SHA1 and SHA2.[L4][CO6][6M]


SHA 1 SHA 2
SHA 2 was released recently in
SHA 1 was released in 1995.
2001.
It is the advanced version of SH0. It is the advanced version of SHA1.
SHA 2 is SHA 1‟s upgraded SHA 3 is SHA 2‟s upgraded
algorithm. algorithm.
SHA 1 is a standalone Hash entity. SHA 2 has many variations.
SHA 1 generates 160 bits hash SHA 2 generates 224-, 256-, 384-
value. or 512-bits hash values.
The length output value of SHA 1 The length output value of SHA 2
is 40 digits. is 64 digits
SHA 1 is less secured when SHA 2 is more secured than SHA 1
compared to SHA 2. but less secure than SHA 3.
SHA 2 is more reliable because of
SHA 1 certificates are not reliable.
its improved certificates.
SHA 2 Family is widely used
SHA 1 is not widely used.
today.

6.Define Digital signature. Write down the steps followed in creating digital
signature. List the Benefits and drawbacks of digital signatures.[L1][CO6][12M]
A digital signature is a mathematical technique used to validate the authenticity and integrity of a
digital document, message or software. A signature confirms that the information originated from
the signer and has not been altered.
Key Generation Algorithms: Digital signature is electronic signatures, which assure that the
message was sent by a particular sender. While performing digital transactions authenticity and
integrity should be assured, otherwise, the data can be altered .
The steps followed in creating digital signature are :
1. Message digest is computed by applying hash function on the message and then message digest is
encrypted using private key of sender to form the digital signature.
2. Digital signature is then transmitted with the message.(message + digital signature is transmitted)
3. Receiver decrypts the digital signature using the public key of sender.
4. The receiver now has the message digest.
5. The receiver can compute the message digest from the message (actual message is sent with the
digital signature).
6. The message digest computed by receiver and the message digest (got by decryption on digital
signature) need to be same for ensuring integrity.
Message digest is computed using one-way hash function, i.e. a hash function in which
computation of hash value of a message is easy but computation of the message from hash value
of the message is very difficult.

Benefits of Digital Signatures


 Legal documents and contracts: Digital signatures are legally binding. This makes them ideal
for any legal document that requires a signature authenticated by one or more parties and
guarantees that the record has not been altered.
 Sales contracts: Digital signing of contracts and sales contracts authenticates the identity of the
seller and the buyer, and both parties can be sure that the signatures are legally binding and that
the terms of the agreement have not been changed.
 Financial Documents: Finance departments digitally sign invoices so customers can trust that the
payment request is from the right seller, not from a bad actor trying to trick the buyer into sending
payments to a fraudulent account.
 Health Data: In the healthcare industry, privacy is paramount for both patient records and
research data. Digital signatures ensure that this confidential information was not modified w hen
it was transmitted between the consenting parties.
 Shipping Documents: Helps manufacturers avoid costly shipping errors.However, physical
papers are cumbersome, not always easily accessible during transport, and can be lost. By
digitally signing shipping documents, the sender and recipient can quickly access a file, check
that the signature is up to date, and ensure that no tampering has occurred.
Drawbacks of Digital Signatures
 Dependence on Key Management: Digital signatures rely on the secure management of
cryptographic keys. This means that the sender must keep their private key safe and secure from
unauthorized access, while the recipient must verify the sender‟s public key to ensure its
authenticity.
 Complexity: Digital signatures require a complex process of key generation, signing, and
verification. This can make them difficult to implement and use for non-technical users.
 Compatibility: Different digital signature algorithms and formats may not be compatible with
each other, making it difficult to exchange signed messages across different systems and
applications.
 Legal Recognition: Although digital signatures have legal recognition in many countries, their
legal status may not be clear in all jurisdictions.
 Revocation: In case of key compromise or other security issues, digital signatures must be
revoked to prevent their misuse. However, the revocation process can be complex and may not be
effective in all cases.
 Cost: Digital signatures may involve additional costs for key management, certificate issuance,
and other related services, which can make them expensive for some users or organizations.
 Limited Scope: Digital signatures provide authentication and integrity protection for a message,
but they do not provide confidentiality or protection against other types of attacks, such as denial -
of-service attacks or malware.

7.a.Illustrate the steps involved in DSA Algorithm.[L3][CO6][6M]


The first part of the DSA algorithm is the public key and private key generation through some steps,
which can be told as:
 Firstly, choose a prime number q, which is called the prime divisor in this.
 Then, choose another primer number p, such that p-1 mod q = 0. p is called the prime modulus in
this.
 Then, choose an integer g, such that 1 < g < p, g**q mod p = 1 and g = h**((p–1)/q) mod p. q is
also called g's multiplicative order modulo p in this algorithm.
 Then, choose an integer, such that 0 < x < q for this.
 Now, compute y as g**x mod p.
 Thus, Package the public key as {p,q,g,y} is this.
 And, Package the private key as {p,q,g,x} is this.
Then, the second part of the DSA algorithm is the signature generation and signature verification in
this algorithm, which can be told as:
Firstly, to generate a message signature, the sender can follow these further steps:
 Firstly, generate the message digest h, using a hash algorithm like SHA1.
 Then, generate a random number k, such that 0 < k < q.
 Then, Computer as (g**k mod p) mod q. If r = 0, select a different k.
 And, Compute i, such that k*i mod q = 1. i is called the modular multiplicative inverse of k modulo
q in this.
 Then, Compute s = i*(h+r*x) mod q. If s = 0, select a different k.
 Thus, Package the digital signature as {r,s}.
Then, to verify a message signature, the receiver of the message and the digital signature can follow
these further steps as:
 Firstly, Generate the message digest h, using the same hash algorithm.
 Then, Compute w, such that s*w mod q = 1. w is called the modular multiplicative inverse of s
modulo q in this.
 Then, Compute u1 = h*w mod q.
 And, Compute u2 = r*w mod q.
 Then, Compute v = (((g**u1)*(y**u2)) mod p) mod q.
 Wherever, If v == r, the digital signature is valid.

b.Examine the Proof of Digital signature algorithm.[L3][CO6][6M]


The DSA algorithm involves four operations: key generation (which creates the key pair), key
distribution, signing and signature verification.
1. Key generation. Key generation has two phases. ...
2. Key distribution. The signer should publish the public key . ...
3. Signing. A message is signed as follows: ...
4. Signature Verification.
Digital Signature
A digital signature is a mathematical technique used to validate the authenticity and integrity of a
message, software, or digital document.
1. Key Generation Algorithms: Digital signature is electronic signatures, which assure that the
message was sent by a particular sender. While performing digital transactions authenticity and
integrity should be assured, otherwise, the data can be altered or someone can also act as if he was
the sender and expect a reply.
2. Signing Algorithms: To create a digital signature, signing algorithms like email programs create a
one-way hash of the electronic data which is to be signed. The signing algorithm then encrypts the
hash value using the private key (signature key). This encrypted hash along with other information
like the hashing algorithm is the digital signature. This digital signature is appended with the data
and sent to the verifier. The reason for encrypting the hash instead of the entire message or
document is that a hash function converts any arbitrary input into a much shorter fixed -length value.
This saves time as now instead of signing a long message a shorter hash value has to be signed and
moreover hashing is much faster than signing.
3. Signature Verification Algorithms : Verifier receives Digital Signature along with the data. It then
uses Verification algorithm to process on the digital signature and the public key (verification key)
and generates some value. It also applies the same hash function on the received data and generates
a hash value. Then the hash value and the output of the verification algorithm are compared. If they
both are equal, then the digital signature is valid else it is invalid.
Types of Encryption
1. Symmetric Encryption– Data is encrypted using a key and the decryption is also done using the
same key.
2. Asymmetric Encryption-Asymmetric Cryptography is also known as public-key cryptography. It
uses public and private keys to encrypt and decrypt data. One key in the pair which can be shared
with everyone is called the public key. The other key in the pair which is kept secret and is only
known by the owner is called the private key. Either of the keys can be used to encrypt a message;
the opposite key from the one used to encrypt the message is used for decryption.
8.Explain various types of Authentication Protocols and its advantages and
disadvantages. [L2][CO6][12M]
1. Kerberos :
Kerberos is a protocol that aids in network authentication. This is used for validating clients/servers
during a network employing a cryptographic key. It is designed for executing strong authentication
while reporting to applications. The overall implementation of the Kerberos protocol is openly
available by MIT and is used in many mass-produced products.

Some advantages of Kerberos:


It supports various operating systems.
 The authentication key is shared much efficiently than public sharing.
Some disadvantages of Kerberos :
 It is used only to authenticate clients and services used by them.
 It shows vulnerability to soft or weak passwords.
2. Lightweight Directory Access Protocol (LDAP) :
LDAP refers to Lightweight Directory Access Protocol. It is a protocol that is used for determining
any individuals, organizations, and other devices during a network regardless of being on public or
corporate internet. It is practiced as Directories-as-a-Service and is the grounds for Microsoft
building Activity Directory.

Some advantages of LDAP :


 It is an automated protocol which makes it modernizing easier.
 It supports existing technologies and allows multiple directories.
Some disadvantages of LDAP :
 It requires the experience of deployment.
 The directory servers are required to be LDAP obedient for deployment.
3. OAuth2 :
OAuth as the name suggests it is an authorization framework that promotes granting limited access
to the user on its account through an HTTP service. When a user requests access to resources an
API call is made and after the authentication token is passed.
Some advantages of OAuth2 :
 It is a simple protocol and is easy to implement.
 It provides server-side authorization of code.
Some disadvantages of OAuth2 :
 It is vulnerable to manage different sets of code.
 It shows serious effects on sites connected to another affected system.
4. SAML :
SAML stands for Security Assertion Markup Language which is based on XML-based
authentication data format which provides the authorization between an identity provider and
service provider. It serves as a product of the OASIS Security Services Technical Committee.

Some advantages of SAML :


 It reduced the administrative costs for the end-users.
 It provides a single sign-in for authenticating across service providers.
Some disadvantages of SAML :
 It is dependent on the identity provider.
 All the data is managed in a single XML format.
5. RADIUS :
RADIUS stands for Remote Authentication Dial-In User Service. It is a network protocol that
provides sufficient centralized Authentication, Accounting, and Authorization for the users that use
and network services. The functioning of the protocol occurs when the user requests access to
network resources, where the RADIUS server encrypts the credentials which are entered by the
user. After this, the user credentials are mapped through the local database and provide access.

Some advantages of RADIUS :


 It is a great mechanism for providing multiple access for Admins.
 It provides a unique identity to each user in a session.
Some disadvantages of RADIUS :
 Initial implementation for this mechanism is hard on hardware.
 It has a variety of models that may require a special team which is cost consuming.
Differentiating between the protocols will not make justice to the protocols because it depends on
the use of the application and for what purpose it is being used.

9.Discuss about Digital Signature Standard approach. Identify the benefits and
Problems of DSS.[L2][CO6][12M]
Signature is a way of authenticating the data coming from a trusted individual. Similarly, digital
signature is a way of authenticating a digital data coming from a trusted source.
 Digital Signature Standard (DSS) is a Federal Information Processing Standard(FIPS) which
defines algorithms that are used to generate digital signatures with the help of Secure Hash
Algorithm(SHA) for the authentication of electronic documents.
 DSS only provides us with the digital signature function and not with any encryption or key
exchanging strategies.

Sender Side : In DSS Approach, a hash code is generated out of the message and following inputs
are given to the signature function –
1. The hash code.
2. The random number „k‟ generated for that particular signature.
3. The private key of the sender i.e., PR(a).
4. A global public key(which is a set of parameters for the communicating principles) i.e., PU(g).
These input to the function will provide us with the output signature containing two components –
„s‟ and „r‟. Therefore, the original message concatenated with the signature is sent to the receiver.
Receiver Side: At the receiver end, verification of the sender is done. The hash code of the sent
message is generated. There is a verification function which takes the following inputs –
1. The hash code generated by the receiver.
2. Signature components „s‟ and „r‟.
3. Public key of the sender.
4. Global public key.
The output of the verification function is compared with the signature component „r‟. Both the
values will match if the sent signature is valid because only the sender with the help of it private
key can generate a valid signature.
Benefits of advanced signature:
1.A computerized signature gives better security in the exchange. Any unapproved individual can‟t
do fakeness in exchanges.
2.You can undoubtedly follow the situation with the archives on which the computerized mark is
applied..
3.It is 100 percent lawful it is given by the public authority approved ensuring authority.
4.In the event that you have marked a report carefully, you can‟t deny it.
5.In this mark, When a record is get marked, date and time are consequently stepped on it.
6.It is preposterous to expect to duplicate or change the report marked carefully.
Burdens of computerized signature:
1.You really want to investigate all the similarity issues. In there are a great deal of similarity
settings like a refreshed rendition of driver and programming.
2.Programming is one of the main pressing concerns while utilizing a computerized signature
testament.
3.In this signature, Lost or burglary of keys and the utilization of weak storage spaces.
4.There is a more grounded need for a norm through which these various strategies can cooperate.
5.To successfully utilize a computerized signature, the two shippers and beneficiaries might need to
purchase computerized endorsements.
6.To work with computerized endorsements, the shipper and beneficiaries need to purchase check
programming at an expense.

10. a. Describe the steps taken to ensure security, signing the Digest in Digital Signature
algorithm.[L2][CO6][6M]
Following are the steps taken to ensure security:
 The miniature version (digest) of the message is created by using a hash function.
 The digest is encrypted by using the sender's private key.
 After the digest is encrypted, then the encrypted digest is attached to the original message and sent
to the receiver.
 The receiver receives the original message and encrypted digest and separates the two. The
receiver implements the hash function on the original message to create the second digest, and it
also decrypts the received digest by using the public key of the sender. If both the digests are
same, then all the aspects of security are preserved.
Signing the Digest
 Public key encryption is efficient if the message is short. If the message is long, a public key
encryption is inefficient to use. The solution to this problem is to let the sender sign a digest of the
document instead of the whole document.
 The sender creates a miniature version (digest) of the document and then signs it, the receiver
checks the signature of the miniature version.
 The hash function is used to create a digest of the message. The hash function creates a fixed-size
digest from the variable-length message.
 The two most common hash functions used: MD5 (Message Digest 5) and SHA-1 (Secure Hash
Algorithm 1). The first one produces 120-bit digest while the second one produces a 160-bit
digest.
 A hash function must have two properties to ensure the success:
 First, the digest must be one way, i.e., the digest can only be created from the message but
not vice versa.
 Second, hashing is a one-to-one function, i.e., two messages should not create the same
digest.
b. Examine Secure Hash Algorithm and applications.[L4][CO6][6M]
 SHA stands for secure hashing algorithm. SHA is a modified version of MD5 and used for
hashing data and certificates. A hashing algorithm shortens the input data into a smaller form
that cannot be understood by using bitwise operations, modular additions, and compression
functions.
 It produces a unique hash in an unreadable format. This is to make your data secure and
unhackable.
 Additionally, SHA uses MD5, SHA 1, or SHA 256 for symmetric cryptography. They generate
hash values to encrypt and decrypt data securely.
Hashing:
 „Hashing‟ is a cryptographic process that is used to determine the authenticity of various inputs.
Additionally, it is used to validate the integrity of your files, documents, and other types of data
that floats all over the internet.
Hash:
A Hash is the result of a mathematical algorithm (Hash Function) that converts a simple data input
into an unreadable format. This „Simple‟ data could include any text, picture, audio, or video
converted into a string of characters.

 Fundamentally, A hash function takes a string of inputs of any arbitrary size and converts them
into unique incomprehensible data of a fixed size.
 Meaning, an input data of any length will be converted into a fixed-size hash. However, if you
change input values even slightly, the output hash will be completely different.

This is how a Hash generates a unique string of incomprehensible data for every slight change.
Now, let‟s understand the ‘Fixed Size’ aspect of the Hash.
The above example converted the input data into SHA 1 output. These SHA 1 outputs have a 160-
bit (20-byte) hash value. And, you can render them as 40 digits long. Whereas, The SHA 2 Family
hash is 224 bits long.
How does hash encryption work
 Digital Signatures need hash functions to encrypt and decrypt their data. The receiver
receives these encrypted keys for further decryption.
 Then the same Hash function generates a decrypted hash value. For a successful transmission, both
the Hash values must be the same. This implies, that the source is authentic and reliable.
Broken Hash
Hash functions create a unique hash value for every piece of data. Meaning, if you Hash the word
„Elon‟ it will yield a certain output. One that looks nothing like the text „Elon‟. If you change the
text „Elon‟ to „ELON‟ the hash value will be completely different. That‟s a good hash.
If a Hash DOESN‟T generate a unique output for every input, that‟s a security hazard and a Broken
Hash.
Applications of Hash Functions
There are two direct applications of hash function based on its cryptographic properties.
Password Storage
Hash functions provide protection to password storage.
 Instead of storing password in clear, mostly all logon processes store the hash values of passwords
in the file.
 The Password file consists of a table of pairs which are in the form (user id, h(P)).

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy