0% found this document useful (0 votes)
3 views

Computer Security Unit 1[1]

The document provides an overview of computer security, focusing on key concepts such as information security, cyber security, and network security, along with the CIA triad (Confidentiality, Integrity, Availability) that defines security objectives. It discusses various types of threats, attacks, and countermeasures, including active and passive attacks, as well as specific attack types like DDoS and phishing. Additionally, it covers essential terminology and the importance of maintaining security policies and practices to protect information systems.

Uploaded by

4488harsha
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)
3 views

Computer Security Unit 1[1]

The document provides an overview of computer security, focusing on key concepts such as information security, cyber security, and network security, along with the CIA triad (Confidentiality, Integrity, Availability) that defines security objectives. It discusses various types of threats, attacks, and countermeasures, including active and passive attacks, as well as specific attack types like DDoS and phishing. Additionally, it covers essential terminology and the importance of maintaining security policies and practices to protect information systems.

Uploaded by

4488harsha
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/ 162

Computer security

22AIE314

Unit I Syllabus

Basics of Computer Security: Overview – Definition of terms –


Security goals – Shortcomings – Attack and defense –
Malicious code – Worms – Intruders – Error detection and
correction Encryption and Cryptography: Ciphers and codes –
Public key algorithms – Key distribution – Digital signatures.
.
2/11/2025 1
What Is Information Security?
• InfoSec, or information security, is a set of tools and practices
that you can use to protect your digital and analog information.

• InfoSec covers a range of IT domains, including infrastructure and


network security, auditing, and testing.

2/11/2025 2
Information security, cyber security, and network security are all
related fields that protect data and systems from security
threats, but they differ in scope and focus:
•Information security: Protects data in all forms, including digital
and physical, across its entire lifecycle. This includes protecting
the confidentiality, integrity, and availability of information.
•Cyber security: Protects internet-connected systems and data
from cyber threats, such as malware, phishing, and
ransomware. It also includes protecting user behavior and
endpoint security.
•Network security: Protects data within a network infrastructure
from threats like unauthorized access, data breaches, and denial-
of-service attacks. It also protects the network's infrastructure,
such as firewalls, routers, and switches.

Information security is the umbrella term, with cyber security


and network security being subsets of it.

2/11/2025 3
A Definition of Computer Security

• Computer Security: Measures and controls that ensure


confidentiality, integrity, and availability of information system
assets including hardware, software, firmware, and information
being processed, stored, and communicated.

2/11/2025 4
Security goals?

2/11/2025 5
CIA triad
Three key objectives that are at the heart of computer security:
• Confidentiality: This term covers two related concepts:
Data confidentiality: Assures that private or confidential information
is not made available or disclosed to unauthorized individuals.
Privacy: Assures that individual's control or influence what
information related to them may be collected and stored and by
whom and to whom that information may be disclosed.
• Integrity: This term covers two related concepts:
Data integrity: Assures that information and programs are changed
only in a specified and authorized manner.
System integrity: Assures that a system performs its intended
function in an unimpaired manner, free from deliberate or
inadvertent unauthorized manipulation of the system.
• Availability: Assures that systems work promptly and service is not
denied to authorized users.

2/11/2025 6
• Confidentiality: Preserving authorized restrictions on
information access and disclosure, including means for
protecting personal privacy and proprietary information.
A loss of confidentiality is the unauthorized disclosure of
information.
• Integrity: Guarding against improper information
modification or destruction, including ensuring information
nonrepudiation and authenticity.
A loss of integrity is the unauthorized modification or
destruction of information.
• Availability: Ensuring timely and reliable access to and
use of information.
A loss of availability is the disruption of access to or use of
information or an information system.
2/11/2025 7
• Although the use of the CIA triad to define security
objectives is well established, some in the security field
feel that additional concepts are needed to present a
complete picture.

Figure: Essential Network and Computer Security Requirements

2/11/2025 8
• Authenticity: The property of being genuine and being able
to be verified and trusted; confidence in the validity of a
transmission, a message, or message.
• Accountability: The security goal that generates the
requirement for actions of an entity to be traced uniquely to
that entity.
• This supports nonrepudiation, deterrence, fault isolation,
intrusion detection and prevention, and after-action recovery
and legal action.
• Because truly secure systems are not yet an achievable goal,
we must be able to trace a security breach to a responsible
party.
• Systems must keep records of their activities to permit later
forensic analysis to trace security breaches or to aid in
transaction disputes.

2/11/2025 9
Computer Security Terminology
• Adversary (threat agent): Individual, group,
organization, or government that conducts or
has the intent to conduct detrimental activities.
• Attack: Any kind of malicious activity that
attempts to collect, disrupt, deny, degrade, or
destroy information system resources or the
information itself.
• Countermeasure: A device or techniques that has as its objective
the impairment of the operational effectiveness of undesirable or
adversarial activity, or the prevention of espionage, sabotage, theft,
or unauthorized access to or use of Sensitive information or
information systems.

2/11/2025 10
Computer Security Terminology
• Risk: A measure of the extent to which an entity
is threatened by a potential circumstance or
event, and typically a function of
1) the adverse impacts that would arise if the circumstance or
event occurs; and 2) the likelihood of occurrence.
• Security Policy: A set of criteria for the provision
of security services.
• It defines and constrains the activities of a data
processing facility in order to maintain a
condition of security for systems and data.

• System Resource (Asset): A major application, general support system, high


impact program, physical plant, mission critical system, personnel, equipment,
or a logically related group of systems.

2/11/2025 11
• Threat: Any circumstance or event with the potential to adversely impact
organizational operations (including mission, functions, image, or
reputation), organizational assets, individuals, other organizations, or the
Nation through an information system via unauthorized access,
destruction, disclosure, modification of information, and/or denial of
service.

• Vulnerability: Weakness in an information system, system security


procedures, internal controls, or implementation that could be
exploited or triggered by a threat source.
2/11/2025 12
A Model for Computer Security
• The assets of a computer system can be categorized as follows:
• Hardware: Including computer systems and other data
processing, data storage, and data communications
devices.
• Software: Including the operating system, system utilities, and
applications.
• Data: Including files and databases, as well as security-related
data, such as password files.
• Communication facilities and networks: Local and wide area
network communication links, bridges, routers, and
so on.

2/11/2025 13
Vulnerabilities of system resources
• In the context of security, our concern is with the FOLLOWING
THREE vulnerabilities of system resources.
• The system can be corrupted, so it does the wrong thing or gives
wrong answers.
• For example, stored data values may differ from what they should
be because they have been improperly modified.
• The system can become leaky. For example, someone who should
not have access to some or all of the information available through
the network obtains such access.
• The system can become unavailable or very slow. That is, using
the system or network becomes impossible or impractical.

2/11/2025 14
• Corresponding to the various types of vulnerabilities to a system
resource are threats that are capable of exploiting those
vulnerabilities.
• A threat represents a potential security harm to an asset.

2/11/2025 Figure: Security Concepts and Relationships 15


• A threat represents a potential security harm to an asset.
• An attack is a threat that is carried out (threat action) and, if
successful, of security, or threat leads to an undesirable violation
consequence.
• The agent carrying out the attack is referred to as an attacker or
threat agent. We can distinguish two types of attacks:
• Active attack: An attempt to alter system resources or affect their
operation.
• Passive attack: An attempt to learn or make use of information from
the system that does not affect system resources.

2/11/2025 16
• We can also classify attacks based on the origin of the attack:
• Inside attack: Initiated by an entity inside the security perimeter
(an “insider”).
• The insider is authorized to access system resources but uses them
in a way not approved by those who granted the authorization.
• Outside attack: Initiated from outside the perimeter, by an
unauthorized or illegitimate user of the system (an “outsider”).
• On the Internet, potential outside attackers range from amateur
pranksters to organized criminals, international terrorists, and
hostile governments.

2/11/2025 17
• A countermeasure is any means taken to deal with a security
attack.
• Ideally, a countermeasure can be devised to prevent a particular
type of attack from succeeding.
• When prevention is not possible, or fails in some instance, the goal
is to detect the attack then recover from the effects of the attack.

2/11/2025 18
THREATS, ATTACKS, AND ASSETS
• There are four kinds of threat consequences and lists the kinds
of attacks that result in each consequence.

2/11/2025 19
Threats and Assets
• The assets of a computer system can be categorized as
hardware, software, data, and communication lines and
networks.

2/11/2025 20
Network security attacks
• Network security attacks can be classified as passive attacks and
active attacks.
• A passive attack attempts to learn or make use of information
from the system, but does not affect system resources.
• An active attack attempts to alter system resources or affect their
operation.

2/11/2025 21
• Passive attacks are in the nature of eavesdropping on, or monitoring of,
transmissions.
• The goal of the attacker is to obtain information that is being transmitted.
• Two types of passive attacks are the release of message contents and
traffic analysis.
• Release of message contents: A telephone conversation, an electronic mail
message, and a transferred file may contain sensitive or confidential
information.
• We would like to prevent an opponent from learning the contents of these
transmissions.
• A second type of passive attack, traffic analysis.
• Suppose we had a way of masking the contents of messages or other
information traffic so opponents, even if they captured the message, could
not extract the information from the message.
• The common technique for masking contents is encryption.
• If we had encryption protection in place, an opponent might still be able to
observe the pattern of these messages.
• The opponent could determine the location and identity of communicating
hosts and could observe the frequency and length of messages being
exchanged.
• This information might be useful in guessing the nature of the
communication
2/11/2025 that was taking place. 22
• Passive attacks are very difficult to detect because they do not
involve any alteration of the data.
• Typically, the message traffic is sent and received in an apparently
normal fashion.
• Neither the sender nor receiver is aware that a third party has read
the messages or observed the traffic pattern.
• However, it is feasible to prevent the success of these attacks,
usually by means of encryption.
• Thus, the emphasis in dealing with passive attacks is on prevention
rather than detection.

• Active attacks involve some modification of the data stream or the


creation of a false stream, and can be subdivided into four
categories: replay, masquerade, modification of messages, and
denial of service.
2/11/2025 23
• Replay involves the passive capture of a data unit and its
subsequent retransmission to produce an unauthorized effect.
• A masquerade takes place when one entity pretends to be a
different entity.
• A masquerade attack usually includes one of the other forms of
active attack.
• A masquerade attack is a cyber attack where an attacker
impersonates a user or device to gain access to a system. Some
examples of masquerade attacks include:
• Username and password masquerade:
• IP address masquerade:
• Website masquerade:
• Email masquerade:

2/11/2025 24
• Modification of messages simply means that some portion of a
legitimate message is altered, or that messages are delayed or
reordered, to produce an unauthorized effect.
• For example, a message stating, “Allow John Smith to read
confidential file accounts” is modified to say, “Allow Fred Brown
to read confidential file accounts.”
• The denial of service prevents or inhibits the normal use or
management of communication facilities.
• This attack may have a specific target; for example, an entity may
suppress all messages directed to a particular destination (e.g.,
the security audit service).
• 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.

2/11/2025 25
• Repudiation:
• This attack is done by either the sender or receiver. The sender or
receiver can deny later that he/she has sent or receive a message.
• For example, the customer asks his Bank “To transfer an amount
to someone” and later on the sender(customer) deny that he had
made such a request. This is repudiation.

2/11/2025 26
Shortcomings?

2/11/2025 27
Phishing attacks?

2/11/2025 28
Defend the Phishing attacks?

2/11/2025 29
Malware attacks?

2/11/2025 30
Defend against the Malware attacks?

2/11/2025 31
Distributed Denial-of Service (DDoS) attacks?
• A distributed denial-of-service (DDoS) attack is a malicious attempt to disrupt the
normal traffic of a targeted server, service or network by overwhelming the target or its
surrounding infrastructure with a flood of Internet traffic.

• From a high level, a DDoS attack is like an unexpected traffic jam clogging up the
highway, preventing regular traffic from arriving at its destination.

2/11/2025 32
Types of DDoS attacks?

1. Application layer attacks

The goal of the attack:


• Sometimes referred to as a layer 7 DDoS attack (in reference to the 7th layer of the OSI
model), the goal of these attacks is to exhaust the target’s resources to create a denial-of-
service.

• The attacks target the layer where web pages are generated on the server and delivered
in response to HTTP requests. A single HTTP request is computationally cheap to execute
on the client side, but it can be expensive for the target server to respond to, as the server
often loads multiple files and runs database queries in order to create a web page.

• Layer 7 attacks are difficult to defend against, since it can be hard to differentiate
malicious traffic from legitimate traffic.

2/11/2025 33
Types of DDoS attacks?
Application layer examples

2/11/2025 34
Types of DDoS attacks?

HTTP flood

• This attack is similar to pressing refresh in a web browser over and over on many
different computers at once – large numbers of HTTP requests flood the server, resulting
in denial-of-service.

• This type of attack ranges from simple to complex.


Simpler implementations may access one URL with the same range of attacking IP
addresses, referrers and user agents. Complex versions may use a large number of
attacking IP addresses, and target random urls using random referrers and user agents.

2/11/2025 35
Types of DDoS attacks?

2. Protocol attacks

The goal of the attack:

• Protocol attacks, also known as a state-exhaustion attacks, cause a service disruption by


over-consuming server resources and/or the resources of network equipment like firewalls
and load balancers.

• Protocol attacks utilize weaknesses in layer 3 and layer 4 of the protocol stack to render
the target inaccessible.

2/11/2025 36
Types of DDoS attacks?

Protocol attack example

2/11/2025 37
Types of DDoS attacks?

SYN flood

• A SYN Flood is analogous to a worker in a supply room receiving requests from the
front of the store.
• The worker receives a request, goes and gets the package, and waits for
confirmation before bringing the package out front. The worker then gets many more
package requests without confirmation until they can’t carry any more packages,
become overwhelmed, and requests start going unanswered.
• This attack exploits the TCP handshake — the sequence of communications by
which two computers initiate a network connection — by sending a target a large
number of TCP “Initial Connection Request” SYN packets with spoofed source IP
addresses.
• The target machine responds to each connection request and then waits for the final
step in the handshake, which never occurs, exhausting the target’s resources in the
process.

2/11/2025 38
Types of DDoS attacks?

3. Volumetric attacks

The goal of the attack:

This category of attacks attempts to create congestion by consuming all available


bandwidth between the target and the larger Internet. Large amounts of data are sent to
a target by using a form of amplification or another means of creating massive traffic,
such as requests from a botnet.

2/11/2025 39
Types of DDoS attacks?

Amplification example:

2/11/2025 40
Types of DDoS attacks?

DNS Amplification

• A DNS amplification is like if someone were to call a restaurant and say “I’ll have one
of everything, please call me back and repeat my whole order,” where the callback
number actually belongs to the victim. With very little effort, a long response is
generated and sent to the victim.

• By making a request to an open DNS server with a spoofed IP address (the IP address
of the victim), the target IP address then receives a response from the server.

2/11/2025 41
Defend the DDoS attacks?

2/11/2025 42
Defend the DDoS attacks?

2/11/2025 43
Ransomware attacks?

2/11/2025 44
Defend the Ransomware attacks?

2/11/2025 45
Defend the Ransomware attacks?

2/11/2025 46
Man in the middle attacks?

2/11/2025 47
Defend the Man in the middle attacks?

2/11/2025 48
SQL injection attacks?

2/11/2025 49
Defend the SQL injection attacks?

2/11/2025 50
Malicious code?

• Malicious code is harmful computer programming scripts designed to create or


exploit system vulnerabilities. This code is designed by a threat actor to cause
unwanted changes, damage, or ongoing access to computer systems.

• It may result in back doors, security breaches, information and data theft, and other
potential damages to files and computing systems.

2/11/2025 51
Types of Malicious code?

2/11/2025 52
Worms?

• Worms are similar to a virus but it does not modify the program. It replicates itself more
and more to slow down the computer system.

• Worms can be controlled by remote. The main objective of worms is to eat the system’s
resources.

•The WannaCry ransomware worm in 2000 exploits the Windows Server Message Block
(SMBv1) which is a resource-sharing protocol.

2/11/2025 53
Worms?
Classifications And Names Of Worms
1. Email-Worm
An email-worm refers to a worm that is able to copy itself and spread through files
attached to email messages.
2. IM-Worm
An Instant Messenger (IM) worm is a kind of worm that can spread through IM networks.
When an IM-worm is operating, it typically finds the address book belonging to the user
and tries to transmit a copy of itself to all of the person’s contacts.
3. IRC-Worm
An IRC-worm makes use of Internet Relay Chat (IRC) networks to send itself over to
other host machines. An IRC-worm drops a script into the IRC’s client directory within the
machine it infects.
4. Net-Worm
A net-worm refers to a kind of worm that can find new hosts by using shares made over a
network. This is done using a server or hard drive that multiple computers access via a
local-area network (LAN).
5. P2P-Worm
A P2P-worm is spread through peer-to-peer (P2P) networks. It uses the P2P connections to
send copies of itself to users.
2/11/2025 54
Intruders?
• Intruders are often referred to as hackers and are the most harmful factors contributing to
security vulnerability.
• They have immense knowledge and an in-depth understanding of technology and
security. Intruders breach the privacy of users and aim to steal the confidential information
of the users.
• The stolen information is then sold to third parties, aiming to misuse it for personal or
professional gains.

2/11/2025 55
Types of Intruders?

Three Classes of Intruders


1. Masquerader – unauthorized user who penetrates a system exploiting a legitimate
user’s account (outside)

2. Misfeasor - legitimate user who makes unauthorized accesses or misuses his


privileges (inside)

3. Clandestine user - seizes supervisory control to evade auditing and access controls
or suppress audit collection (inside|outside)

2/11/2025 56
Types of Intruders?
1. Masquerader

2/11/2025 57
Types of Intruders?

2. Misfeasor

•The category of individuals that are authorized to use the system, but misuse the granted
access and privilege.

•These are individuals that take undue advantage of the permissions and access given to
them, such category of intruders is referred to as Misfeasor.

• Misfeasors are insiders and they have direct access to the system, which they aim to
attack unethically for stealing data/ information.

2/11/2025 58
Types of Intruders?

3. Clandestine User

• The category of individuals who have supervision/administrative control over the system
and misuse the authoritative power given to them.

• The misconduct of power is often done by superlative authorities for financial gains, such
a category of intruders is referred to as Clandestine Users.

• A Clandestine User can be any of the two, insiders or outsiders, and accordingly, they can
have direct/ indirect access to the system, which they aim to attack unethically by stealing
data/ information.

2/11/2025 59
Error detection and correction?

Error

• It is a condition when the receiver’s information does not match the sender’s.

• Digital signals suffer from noise during transmission that can introduce errors in the
binary bits traveling from sender to receiver.

• That means a 0 bit may change to 1 or a 1 bit may change to 0.

2/11/2025 60
Error detection and correction?

Types of Errors

1. Single-Bit Error
A single-bit error refers to a type of
data transmission error that occurs
when one bit (i.e., a single binary
digit) of a transmitted data unit is
altered during transmission, resulting
in an incorrect or corrupted data unit.

2/11/2025 61
Error detection and correction?

2. Multiple-Bit Error
A multiple-bit error is an error type that
arises when more than one bit in a data
transmission is affected. Although
multiple-bit errors are relatively rare
when compared to single-bit errors,
they can still occur, particularly in high-
noise or high-interference digital
environments.

2/11/2025 62
Error detection and correction?

3. Burst Error
When several consecutive bits are flipped
mistakenly in digital transmission, it
creates a burst error. This error causes a
sequence of consecutive incorrect values.

2/11/2025 63
Error detection and correction?

Error Detection Methods


To detect errors, a common technique is to introduce redundancy bits that provide
additional information. Various techniques for error detection include:

1. Simple Parity Check


2. Two-Dimensional Parity Check
3. Checksum
4. Cyclic Redundancy Check (CRC)

2/11/2025 64
Error detection and correction?
Simple Parity Check

1. Simple-bit parity is a simple error detection method that involves adding an extra bit to a
data transmission. It works as:
• 1 is added to the block if it contains an odd number of 1’s, and
• 0 is added if it contains an even number of 1’s.
This scheme makes the total number of 1’s even, that is why it is called even parity checking.

2/11/2025 65
Two-Dimensional Parity Check
• These bits are calculated for each row, which is equivalent to a simple parity check bit.
• Parity check bits are also calculated for all columns, then both are sent along with the
data.
• At the receiving end, these are compared with the parity bits calculated on the received
data.

2/11/2025 66
Checksum

• Checksum error detection is a method used to identify errors in transmitted data.


• The process involves dividing the data into equally sized segments and using a 1’s
complement to calculate the sum of these segments.
• The calculated sum is then sent along with the data to the receiver.
• At the receiver’s end, the same process is repeated and if all zeroes are obtained in the
sum, it means that the data is correct.

Checksum – Operation at Sender’s Side


1. Firstly, the data is divided into ‘k’ segments each of ‘m’ bits.
2. On the sender’s end, the segments are added using 1’s complement arithmetic to get the
sum.
The sum is complemented to get the checksum.
3. The checksum segment is sent along with the data segments.

Checksum – Operation at Receiver’s Side


1. At the receiver’s end, all received segments are added using 1’s complement arithmetic to
get the sum. The sum is complemented.
2. If the result is zero, the received data is accepted; otherwise discarded.
2/11/2025 67
2/11/2025 68
Error detection and correction?
Cyclic Redundancy Check (CRC)

• Unlike the checksum scheme, which is based on addition, CRC is based on binary
division.

• In CRC, a sequence of redundant bits, called cyclic redundancy check bits, are appended
to the end of the data unit so that the resulting data unit becomes exactly divisible by a
second, predetermined binary number.

• At the destination, the incoming data unit is divided by the same number. If at this step
there is no remainder, the data unit is assumed to be correct and is therefore accepted.

• A remainder indicates that the data unit has been damaged in transit and therefore must
be rejected.

2/11/2025 69
Error detection and correction?
Cyclic Redundancy Check (CRC)

2/11/2025 70
CRC Working

We have given dataword of length n and divisor of length k.

Step 1: Append (k-1) zero’s to the original message


Step 2: Perform modulo 2 division
Step 3: Remainder of division = CRC
Step 4: Code word = Data with append k-1 zero’s + CRC

Note:
CRC must be k-1 bits
Length of Code word = n+k-1 bits

Example: Let’s data to be send is 1010000 and divisor in the form of polynomial is
x3+1. CRC method discussed below.

2/11/2025 71
Error detection and correction?

2/11/2025 72
Error detection and correction?

Once the errors are detected in the network, the deviated bits sequence needs to be replaced
with the right bit sequence so that the receiver can accept the data and process it. This
method is called Error Correction. We can correct the errors in the Network in two different
ways which are listed below:

1. Forward Error Correction: In this Error Correction Scenario, the receiving end is
responsible for correcting the network error. There is no need for retransmission of the
data from the sender’s side.

2. Backward Error Correction: In Backward Error Correction, the sender is responsible


for retransmitting the data if errors are detected by the receiver. The receiver signals the
sender to resend the corrupted data or the entire message to ensure accurate delivery.

2/11/2025 73
Error detection and correction?

Hamming Code Error Correction

In this method, extra parity bits are appended to the message which are used by the receiver
to correct the single bit error and multiple bit error. Consider the below example to
understand this method in a better way.
Suppose the sender wants to transmit the message whose bit representation is ‘1011001.’ In
this message:

1. Total number of bits(d) = 7


2. Total of redundant bits(r) = 4 (This is because the message has four 1’s in it)
3. Thus, total bits(d+r) = 7 + 4 = 11
4. Also, by convention, the redundant bits are always placed in the places which are
powers of 2. Now, this message will take the format as shown below:

2/11/2025 74
Error detection and correction?

2/11/2025 75
Error detection and correction?
Therefore, we have R1, R2, R3, and R4 as redundant
bits which will be calculated according to the
following rules:
1. R1 includes all the positions whose binary
representation has 1 in their least significant bit.
Thus, R1 covers positions 1, 3, 5, 7, 9, 11.

2. R2 includes all the positions whose binary


representation has 1 in the second position from the
least significant bit. Thus, R2 covers positions
2,3,6,7,10,11.

3. R3 includes all the positions whose binary


representation has 1 in the third position from the
least significant bit. Hence, R3 covers positions 4,
5, 6, 7.

4. R4 includes all the positions whose binary


representation has 1 in the fourth position from the
least significant bit due to which R4 covers
2/11/2025 76
positions 8,9,10,11.
Error detection and correction?

Now, we calculate the value of R1, R2, R3 and R4 as follows:


1. Since the total number of 1s in all the bit positions corresponding to R1 is an even
number. R1 = 0.
2. Since the total number of 1s in all the bit positions corresponding to R2 is an odd
number, R2= 1.
3. Since the total number of 1s in all the bit positions corresponding to R3 is an odd
number, R3= 1.
4. Since the total number of 1s in all the bit positions corresponding to R4 is even, R4 =
0.
Therefore, the message to be transmitted becomes:

2/11/2025 77
Error detection and correction?

This message is transmitted at the receiver’s end. Suppose, bit 6 becomes corrupted and
changes to 0. Then, the message becomes ‘10101101110.’ So, at the receiver’s end, the
number of 1’s in the respective bit positions of R1, R2, R3, and R4 is rechecked to correct the
corrupted bit. This is done in the following steps:

1. For R1: bits 1, 3, 5, 7, 9, and 11 are checked. We can see that the number of 1’s in these
bit positions is 4(even) so R1 = 0.
2. For R2: bits 2,3,6,7,10,11 are checked. You can observe that the number of 1’s in these bit
positions is 5(odd) so we get a R2 = 1.
3. For R3: bits 4, 5, 6, and 7 are checked. We see that the number of 1’s in these bit
positions is 3(odd). Hence, R3 = 1.
4. For R8: bits 8,9,10,11 are observed. Here, the number of 1’s in these bit positions is 2 and
that’s even so we get R4 = 0.

If we observe the Redundant bits, they give the binary number 0110 whose decimal
representation is 6. Thus, bit 6 contains an error. To correct the error the 6th bit is changed
from 1 to 0 to correct the error.

2/11/2025 78
Cryptography?
❖Cryptography is the technique of coding data, ensuring that only
the person who is meant to see the information–and has the key
to break the code–can read it.
❖The word is a hybrid of two Greek words: “kryptós”, which means
hidden, and “graphein”, which means to write.
❖Literally, the word cryptography translates to hidden writing, but in
reality, the practice involves the secure transmission of information.

2/11/2025 79
Terminologies
• An original message is known as the plaintext, while the coded
message is called the ciphertext.
• The process of converting from plaintext to ciphertext is
known as enciphering or encryption; restoring the plaintext
from the ciphertext is deciphering or decryption.
• The many schemes used for encryption constitute the area of
study known as cryptography.
• Such a scheme is known as a cryptographic system or a
cipher.
• Techniques used for deciphering a message without any
knowledge of the enciphering details fall into the area of
cryptanalysis.
• Cryptanalysis is what the layperson calls “breaking the code.”
• The areas of cryptography and cryptanalysis together are
called cryptology.
2/11/2025 80
Cryptography?

• More technically we can observe the cryptography technique by


the following image:

2/11/2025 81
Encryption and decryption?

2/11/2025 82
Classification of cryptography algorithm?

Cryptography
Algorithm

Symmetric Asymmetric
Key Key

Steam Block RSA ElGamal Rabin ECC


Cipher Cipher

RC-4 OTP A5/1 AES DES Blowfish

2/11/2025 83
Symmetric key cryptography/single-key encryption

2/11/2025 84
Symmetric cipher model
• A symmetric encryption scheme has five ingredients..
• Plaintext: This is the original intelligible message or data that is
fed into the algorithm as input.
• Encryption algorithm: The encryption algorithm performs
various substitutions and transformations on the plaintext.
• Secret key: The secret key is also input to the encryption
algorithm.
• The key is a value independent of the plaintext and of the
algorithm.
• The algorithm will produce a different output depending on the
specific key being used at the time.
• The exact substitutions and transformations performed by the
algorithm depend on the key.
2/11/2025 85
• Ciphertext: This is the scrambled message produced as output.
• It depends on the plaintext and the secret key.
• For a given message, two different keys will produce two different
ciphertexts.
• The ciphertext is an apparently random stream of data and, as it
stands, is unintelligible.
• Decryption algorithm: This is essentially the encryption
algorithm run in reverse.
• It takes the ciphertext and the secret key and produces the original
plaintext.
• There are two requirements for secure use of conventional
encryption:
• 1. We need a strong encryption algorithm.
• 2. Sender and receiver must have obtained copies of the secret key
in a secure fashion and must keep the key secure.

2/11/2025 86
• We assume that it is impractical to decrypt a message
on the basis of the ciphertext plus knowledge of the
encryption/decryption algorithm.
• In other words, we do not need to keep the algorithm
secret; we need to keep only the key secret.

• Let us take a closer look at the essential elements of a


symmetric encryption scheme

2/11/2025 87
• With the message X and the encryption key K as input, the encryption
algorithm forms the ciphertext Y = [Y1, Y2, …… YN].
• We can write this as Y = E(K, X)

2/11/2025 88
• This notation indicates that Y is produced by using encryption
algorithm E as a function of the plaintext X, with the specific function
determined by the value of the key K.
• The intended receiver, in possession of the key, is able to invert the
transformation:
• X = D(K, Y)
• An opponent, observing Y but not having access to K or X, may
attempt to recover X or K or both X and K.
• It is assumed that the opponent knows the encryption (E) and
decryption (D) algorithms.
• If the opponent is interested in only this particular message, then the
focus of the effort is to recover X by generating a plaintext estimate
Xn.
• Often, however, the opponent is interested in being able to read future
messages as well, in which case an attempt is made to recover K by
generating an estimate Kn .
2/11/2025 89
• Cryptographic systems are characterized along three independent
dimensions:
1. The type of operations used for transforming plaintext to ciphertext:
All encryption algorithms are based on two general principles: substitution,
in which each element in the plaintext (bit, letter, group of bits or letters) is
mapped into another element, and transposition, in which elements in the
plaintext are rearranged.
• The fundamental requirement is that no information be lost
2. The number of keys used: If both sender and receiver use the same key,
the system is referred to as symmetric, single-key, secret-key, or
conventional encryption.
• If the sender and receiver use different keys, the system is referred to as
asymmetric, two-key, or public-key encryption.
3. The way in which the plaintext is processed: A block cipher processes
the input one block of elements at a time, producing an output block for each
input block.
• A stream cipher processes the input elements continuously, producing
output one element at a time, as it goes along.
2/11/2025 90
Cryptanalysis and Brute-Force Attack
• Cryptanalysis: Cryptanalytic attacks rely on the nature of the
algorithm plus perhaps some knowledge of the general
characteristics of the plaintext or even some sample plaintext–
ciphertext pairs.
• This type of attack exploits the characteristics of the algorithm
to attempt to deduce a specific plaintext or to deduce the key
being used.
• Brute-force attack: The attacker tries every possible key on a
piece of ciphertext until an intelligible translation into plaintext
is obtained.
• On average, half of all possible keys must be tried to achieve
success.
2/11/2025 91
Various types of cryptanalytic attacks

2/11/2025 92
SUBSTITUTION TECHNIQUES
• A substitution technique is one in which the letters of plaintext are
replaced by other letters or by numbers or symbols.
• If the plaintext is viewed as a sequence of bits, then substitution
involves replacing plaintext bit patterns with ciphertext bit patterns.

• Caesar Cipher: The Caesar cipher involves replacing each letter


of the alphabet with the letter standing three places further down the
alphabet.
• For example,

• plain: meet me after the toga party


………………………………………………………………………

• 2/11/2025
cipher: PHHW PH DIWHU WKH WRJD SDUWB 93
• For each plaintext letter p, substitute the ciphertext letter C:
• C = E(3, p) = (p + 3) mod 26
• A shift may be of any amount, so that the general Caesar algorithm
is C = E(k, p) = (p + k) mod 26

• where k takes on a value in the range 1 to 25. The decryption


algorithm is simply
• p = D(k, C) = (C - k) mod 26

• TASK: If it is known that a given ciphertext is a Caesar cipher, then


how a cryptanalysis can be performed? Show with example.

2/11/2025 94
Monoalphabetic Ciphers
• 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.
• Before proceeding, we define the term permutation.
• 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..

• Note: The difference between plantext and ciphertext letters are


not uniform unlike in caser cipher.

2/11/2025 95
2/11/2025 96
• In Monoalphabetic cipher, the substitute characters symbols
supports a random permutation of 26 letters of the alphabet. 26!
Permutations of the alphabet go up to 4*10^26. This creates it
complex for the hacker to need brute force attack to gain the key.
• Mono-alphabetic cipher is a type of substitution where the
relationship among a symbol in the plaintext and a symbol in the
cipher text is continually one-to-one and it remains fixed throughout
the encryption process.
• For instance, if ‘T’ is encrypted by ‘J’ for any number of appearance
in the plain text message, then ‘T’ will continually be encrypted to
‘J’.

2/11/2025 97
Polyalphabetic Ciphers
• A polyalphabetic cipher is a substitution, using multiple
substitution alphabets.
• Examples of polyalphabetic ciphers:
1. VERNAM Cipher or One-Time Pad Cipher

2/11/2025 98
VERNAM Cipher/One time pad
• Plaintext: H E L L O
7 4 11 11 14
• Key : b a x y c (length should be same as Plaintext and random)
1 0 23 24 2
• Add: 8 4 34 35 16 (Add respective numbers)
• Subtract: 8 4 8 9 16 (Any number in “Add” is more than 26
then subtract the number with 26..otherwise the number will be
the same.
• Ciphertext is: I E I J Q

For decryption: (Cipher text number - key number)= Plaintext number.


Then convert back to letters.
2/11/2025 99
Playfair Cipher
• The best-known multiple-letter encryption cipher is the Playfair, which
treats digrams in the plaintext as single units and translates these units
into ciphertext digrams.
• Digrams: A powerful tool is to look at the frequency of two-letter
combinations, known as digrams
• The Playfair algorithm is based on the use of a 5*5 matrix of letters
constructed using a keyword.
• In this case, the keyword is 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 alphabetic order.
• The letters I and J count as one letter.
• Plaintext is encrypted two letters at a time

2/11/2025 100
1. Repeating plaintext letters that are in the same pair are separated with a
filler letter, such as x, so that balloon would be treated as ba lx lo on.
2. 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.
3. Two plaintext letters that fall in the same column are each replaced by the
letter beneath, with the top element of the column circularly following
the last. For example, mu is encrypted as CM.
4. 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 (or JM, as the encipherer
wishes).
2/11/2025 101
Hill cipher

2/11/2025 102
TRANSPOSITION TECHNIQUES
• Here, the position will be changed for the original alphabets.
• Columnar transposition technique:
• Let the plaintext is: LIFEBRINGSALWAYSCHALLENGE
Key = 43512 (the individual key digits should not be greater than 5
(can be equal to) which is the highest row number)

1 2 3 4 5
L I F E B
R I N G S
A L W A Y
S C H A L
2/11/2025
L E N G E 103
1 2 3 4 5
L I F E B
R I N G S
A L W A Y
S C H A L
L E N G E
• Ciphertext= based on the key value choose the characters in the column from the
matrix.
• Here key is 43512
• So, in 4th column-→EGAAG
• in 3rd column-→FNWHN
• in 5th column-→BSYLE
• in 1st column-→FISNN
• in 2nd column-→IILCE
• So, ciphertext is: EGAAGFNWHNBSYLEFISNNIILCE

• Now the task is to find the plaintext back at the receiver end.
2/11/2025 104
Keyless transposition techniques
• Let the plaintext is: LIFEBRINGSALWAYSCHALLENGE
❖ I E R N S L A S H L E G
❖L F B I G A W Y C A L N E

• Ciphertext = IERNSLASHLEGLFBIGAWYCALNE
• The decryption process is opposite of encryption.

2/11/2025 105
Block cipher
• Block Cipher and Stream Cipher are the types of symmetric key
ciphers.
• A block cipher encrypts data in fixed-size blocks usually 64 or 128
bits at a time.
• The encryption algorithm processes each block of data separately
using the cryptographic key to transform the plaintext into the
ciphertext.
• The strength of the cipher depends upon the key length.
• However, any size of the block is acceptable.
• The following aspects can be kept in mind while selecting the size
of a block:
• Avoid very small block sizes,
• Do not have very large block sizes, and
2/11/2025• Multiples of 8-bit. 106
Key Features of Block Ciphers
• Fixed Block Size: The Data is encrypted in a fixed-size block.
• Complex Operations: In block ciphers, substitution combined
with permutation forms the operation to achieve encryption.
• Modes of Operation: Block ciphers employ several modes such
as ECB (Electronic Codebook) and CBC (Cipher Block
Chaining) for enhanced security.
• Examples: AES (Advanced Encryption Standard), DES (Data
Encryption Standard) and Blowfish.

2/11/2025 107
2/11/2025 108
Stream ciphers?

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 key stream. The
resulted key stream will be of size 1 byte, i.e., 8 bits. Stream ciphers are fast because they
encrypt data bit by bit or byte by byte, which makes them efficient for encrypting large
amounts of data quickly.

2/11/2025 109
Stream Cipher
• A stream cipher encrypts data one bit or one byte at a time
rather than in fixed-size blocks.
• It generates a keystream that is combined with the plaintext to
produce ciphertext.
• Stream ciphers are made for scenarios where data needs to be
encrypted in the continuous stream making them suitable for real-
time applications.

2/11/2025 110
Key Features of Stream Ciphers
• Continuous Encryption: The data is encrypted in a stream that
runs continuously, a bit or byte at a time
• Keystream Generation: To create encryption keys, the Stream
ciphers use a pseudorandom keystream generator.
• Efficiency: Stream ciphers are generally more efficient for
encrypting data of variable length and in streaming applications.
• Examples: RC4, Salsa20, and ChaCha20.

• Examples of classical stream ciphers is the the Vernam cipher.

2/11/2025 111
Block Cipher Stream Cipher
Block Cipher Converts the plain text into Stream Cipher Converts the plain text into cipher
cipher text by taking plain text’s block at a text by taking 1 bit plain text at a time.
time.
Block cipher uses either 64 bits or more than While stream cipher uses 8 bits.
64 bits.
The complexity of block cipher is simple. While stream cipher is more complex.
Block cipher uses confusion as well as While stream cipher uses only confusion.
diffusion.
In block cipher, reverse encrypted text is While in-stream cipher, reverse encrypted text is
hard. easy.
The algorithm modes which are used in block The algorithm modes which are used in stream
cipher are ECB (Electronic Code Book) and cipher are CFB (Cipher Feedback) and OFB
CBC (Cipher Block Chaining). (Output Feedback).
Block cipher works on transposition While stream cipher works on substitution
techniques like rail-fence techniques like Caesar cipher, polygram
technique, columnar transposition technique, substitution cipher, etc.
etc.
Block cipher is slow as compared to a stream While stream cipher is fast in comparison to block
2/11/2025
cipher. cipher.
Confusion and Diffusion

• To confuse the attacker and to avoid statistical analysis,


Shannon suggested 2 methods for data security:
➢ Confusion: It hides the relationship between the plaintext and
key.
➢ Diffusion: If one symbol/text in the plaintext is changed then
several/all symbols/texts in the ciphertexts also will change.
• The idea of diffusion is to hide the relationship between
plaintext and ciphertext.

2/11/2025 113
Feistel Cipher

2/11/2025 114
Data encryption standard (DES)

2/11/2025 115
Data encryption standard (DES)
• DES is a block cipher technique.
• The size of the plaintext block is of 64 bit.
• The size of initial key also of 64 bit size.
• Step 1: is to perform the initial permutation(IP). Here the bits are needs to be
rearranged in a particular order. The o/p of IP step is of the same 64 bits.
• Then, 16 rounds are performed.
• The input to round 1 is 64 bits output from IP and 48-bit key.
• Actually, 64 bit keys are converted to 48 bit key.
• From the original 64 key bits, 8 bits are parity bits (will be removed in permuted
choice-1 step). So, the output of PC-1 is 56 bits. So which 8 bits will be
discarded..that is every 8th bit of the 64 bits are discarded. i.e. the discarded bits
are, 8th , 16th , 24th , 32th, 40th, 48th, 56th , 64th bit.
• Now the total 56 bits are divided in two equal halfs..i.e, each of 28th bits..
• Now apply left circular shift to move the bits..So how many bits to be shifted is
depends on round number..
2/11/2025 116
• It means, if the round numbers are 1,2,9,16 then only one bit shift is done
else for any other rounds it will be 2 bit shift.
• After shifting it will have each 28 bits in each block.
• Then it will be combined to make 56 bits again and given to PC2.
• PC2 will permute the 56 bits to 48 bits (compressed
permutation/rearranging)and it is the input to round 1.
• The 48 key bits produced by each round by PC2 are different for different
rounds.
• After 16 rounds are completed the final permutation is done..It is also called
inverse initial permutation (inverse of initial permutation).
• The output of the final permutation is the ciphertext.
• The core/heart of DES is round function (If DES is body).
• So, what happens in round function….

2/11/2025 117
• DES is based on the Feistel Cipher, all that is required to specify
DES is −
1. Round function
2. Key schedule
3. Any additional processing − Initial and final permutation

2/11/2025 118
Initial and Final Permutation
• The initial and final permutations are straight Permutation boxes (P-
boxes) that are inverses of each other.
• They have no cryptography significance in DES.
• The initial and final permutations are shown as follows:

2/11/2025 119
Round function in DES
• The heart of this cipher is the DES function or round function.
• The DES function applies a 48-bit key to the rightmost 32
bits to produce a 32-bit output.
• There will be eight S-boxes.

2/11/2025 120
Stream ciphers?

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 key stream. The
resulted key stream will be of size 1 byte, i.e., 8 bits. Stream ciphers are fast because they
encrypt data bit by bit or byte by byte, which makes them efficient for encrypting large
amounts of data quickly.

2/11/2025 121
RC4 ciphers?

• RC4 (Rivest Cipher 4) is a widely used symmetric stream cipher designed by Ron
Rivest in 1987. It is known for its simplicity and speed in software implementations.

• RC4 is a stream cipher that encrypts data one byte at a time by generating a pseudo-
random keystream and XORing it with the plaintext (for encryption) or ciphertext (for
decryption).

• It operates with a variable-length key, typically between 40 and 256 bits, making it
adaptable to different levels of security.

2/11/2025 122
Block ciphers?

• A block cipher is a type of symmetric-


key cipher that encrypts data in fixed-size
blocks, typically 64 or 128 bits at a time.

• In a block cipher, both the plaintext and


ciphertext are divided into equal-sized
blocks, and each block of plaintext is
transformed into a block of ciphertext
using the same encryption algorithm and
a secret key.

2/11/2025 123
Advanced Encryption Standard (AES)?

➢ This 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 a block cipher encryption developed for symmetric key cryptography


where he key size can be 128/192/256 bits.

➢ If it takes 128 bits as inputs then output will also be 128 bits.

➢ In the context of security, this is much stronger than Data Encryption Standard
(DES) and Triple DES.

2/11/2025 124
AES algorithm? Plaintext (128 bits)
Key (128 bits)

➢ The plaintext can be represented by some format. Add round key W [0, 3]
➢ Lets assume the plaintext as 4 x 4 matrix. Each cell is of 8 bit.

Substitute bytes

R1

Shift rows Expand key

Mix columns

➢ The keys are 44 word. The 128-bits will go to the add round Add round key W [0, 7]
key function and there perform an XOR between the plain text
and first four key from 0 to 3.

➢ Then on the next round the key will expand into 4 to 7.


Substitute bytes
➢ The AES-128 has 10 rounds.
R10

➢ From round 1 to 9, the steps are same, in the 10 th round the Shift rows

Mixed column not there.

Add round key W [40, 43]

2/11/2025 Ciphertext (128 bits) 125


AES algorithm?

4x4 Substitute 4x4 Shift rows 4x4 Mixed columns


Plaintext bytes

16 x 16 4x4 Add round key 4x4


S-BOX Ciphertext

4 bytes
round key

➢ The first 4x4 input will go to the substitute bytes.

➢ Another 16 x 16 S-BOX will add as an input to the substitute bytes.

➢ The corresponding output will generate 4 x 4 matrix.

2/11/2025 126
AES algorithm?
Lets understand what is there in substitution bytes

S(0,0) S’(0,0)

Suppose S(0,0) is 84 and the So, the S’(0,0) is 20 and


binary representation is 01010100 the binary representation
AES is 00010100
S-table

1 2 3 4 5 6 7
2
➢ As the input number is 01010100. We split
3 the number into two parts such as 0101 and
0100. Now 0101=5 and 0100=4.
4 ➢ It means the output value is in the 5th row
and 4th column of the AES S-table.
5 20 ➢ Suppose the value is 20. It will incorporate
as the S’(0, 0).
6
2/11/2025 127
AES algorithm?
➢ After the substitute bytes the 4 x 4 matrix output will perform shift rows.
➢ Lets understand what is there in the Shift rows.
➢ The shift rows will follow circular motion towards left.

S(0,0) S(0,1) S(0,2) S(0,3) S(0,0) S(0,1) S(0,2) S(0,3)

S(1,0) S(1,1) S(1,2) S(1,3) S(1,1) S(1,2) S(1,3) S(1,0)

S(2,0) S(2,1) S(2,2) S(2,3) S(2,2) S(2,3) S(2,0) S(2,1)

S(3,0) S(3,1) S(3,2) S(3,3) S(3,3) S(3,0) S(3,1) S(3,2)

The shift depends in the row numbers:


➢ If the row number is 0 then shift 0 byte.
➢ If the row number is 1 then shift 1 byte.
➢ If the row number is 2 then shift 2 bytes.
➢ If the row number is 3 then shift 3 bytes.

2/11/2025 128
AES algorithm?
The next step is mix column

2 3 1 1 3

1 2 3 1 2
X
1 1 2 3 1

3 1 1 2 1

4 x 4 pre 4 x 1 output
defined matrix from shift
2 3 1 1 rows 14

1 2 3 1 11

1 1 2 3 10

3 1 1 2 14

2/11/2025 129
AES algorithm ?

➢ At last, again one more add round key is there.


➢ The 4 bytes round key are XORed with the 4 x 4 matrix achieved from the
mixed columns.

S(0,0) S(0,1) S(0,2) S(0,3)

S(1,0) S(1,1) S(1,2) S(1,3)


Wi Wi+1 Wi+2 Wi+3
S(2,0) S(2,1) S(2,2) S(2,3)

S(3,0) S(3,1) S(3,2) S(3,3)

2/11/2025 130
Data encryption standards (DES) ?

➢ The Data Encryption Standard (DES) was jointly developed in 1974 by IBM
and the U.S. government (US patent 3,962,539) to set a standard that everyone
could use to securely communicate with each other.

➢ It operates on blocks of 64 bits using a secret key that is 56 bits long. The
original proposal used a secret key that was 64 bits long.

➢ It is widely believed that the removal of these 8 bits from the key was done to
make it possible for U.S. government agencies to secretly crack messages.

2/11/2025 131
Data encryption standards (DES) ?

➢ Encryption of a block of the message takes place in 16 stages or rounds.

➢ From the input key, sixteen 48 bit keys are generated, one for each round. In
each round, eight so-called S-boxes are used.

➢ These S-boxes are fixed in the specification of the standard. Using the S-boxes,
groups of six bits are mapped to groups of four bits.

➢ The contents of these S-boxes has been determined by the U.S. National
Security Agency (NSA). The S-boxes appear to be randomly filled, but this is not
the case. Recently it has been discovered that these S-boxes, determined in the
1970s, are resistant against an attack called differential cryptanalysis which was
first known in the 1990s.

2/11/2025 132
DES algorithm?
• The block of the message is divided into two
halves.

• The right half is expanded from 32 to 48 bits


using another fixed table.

• The result is combined with the subkey for


that round using the XOR operation. Using the
S-boxes the 48 resulting bits are then
transformed again to 32 bits, which are
subsequently permutated again using yet
another fixed table.

• This by now thoroughly shuffled right half is


now combined with the left half using the XOR
operation. In the next round, this combination
is used as the new left half.

• The figure should hopefully make this


process a bit more clear. In the figure, the left
and right halves are denotes as L0 and R0, and
in subsequent rounds as L1, R1, L2, R2 and so
on. The function f is responsible for all the
mappings described above.

2/11/2025 133
Blowfish?
• A symmetric-key block cipher called blowfish encryption is frequently used for
password hashing, VPNs, and file encryption. Since its introduction in 1993, this
encryption method has gained popularity due to its effective encryption and decryption
operations.

• However, more recent, more secure algorithms like AES are gradually taking the
place of Blowfish.

• Blowfish is a 64-bit block cipher that uses symmetric encryption and a key that can be
up to 448 bits long.

• It was created in 1993 by Bruce Schneier to replace the outdated Data Encryption
Standard (DES) and International Data Encryption Algorithm (IDEA) encryption
methods.

2/11/2025 134
Blowfish algorithm?

2/11/2025 135
Blowfish algorithm?

Step 1 − First, we divided the 64-bit plaintext into two equal blocks, L and R, each
containing 32 bits.

Step 2 − The following actions are taken in each of the 16 encryption cycles that we
begin in the following step −
2.1. Now, the L and the first member of the P-array (P1) are XORed.
2.2. Then XOR R with F, where F is a function of L and uses the four blocks that
make up the S-box. Below is a summary of function F in entirety.
2.3. The next iteration of the loop starts once L and R are switched.

Step 3 − L and R are switched again after the loop is completed.

Step 4 − XOR R with P17 and L with P18 to get the final two unused P-box entries
(P17 & P18).

Step 5 - The cipher text is obtained by combining L and R in the final step.

2/11/2025 136
Asymmetric key cryptography?

2/11/2025 137
Asymmetric key cryptography?

An example of symmetric or public key cryptography using Bob and Alice

2/11/2025 138
RSA ?

• RSA (Rivest-Shamir-Adleman) is one of the first public-key cryptosystems and is


widely used for secure data transmission.

• It is named after its inventors, Ron Rivest, Adi Shamir, and Leonard Adleman,
who described the algorithm in 1977.

• RSA is a type of public-key cryptography, which means it uses a pair of keys – a


public key and a private key.
1. Public Key: Used for encryption and can be shared openly.
2. Private Key: Used for decryption and must be kept secret.

• RSA's security relies on the practical difficulty of factoring the product of two
large prime numbers.

2/11/2025 139
Key Components of RSA?

Public Key (e, n):


e: Public exponent.
n: Modulus, the product of two large prime numbers p and q.

Private Key (d, n):


d: Private exponent.
n: Modulus (same as in the public key).

2/11/2025 140
Key Generation Process ?

2/11/2025 141
Encryption and Decryption ?

2/11/2025 142
Example illustration ?

2/11/2025 143
Example illustration ?

2/11/2025 144
Example illustration ?

2/11/2025 145
Example illustration ?

2/11/2025 146
Elgamal ?

• ElGamal cryptography is an asymmetric key encryption algorithm used for secure


communication.
• It is based on the Diffie-Hellman key exchange and operates on the principles of
public-key cryptography.
• It was proposed by Taher ElGamal in 1985 and is widely used for encryption and digital
signatures.

2/11/2025 147
Diffie Hellman ?
• Lets understand Diffie Hellman key exchange before Elgamal
• The Diffie-Hellman key exchange (also known as exponential key exchange) is a
method for securely exchanging cryptographic keys over an insecure channel. It is a
fundamental building block of many secure communication protocols, including SSL/TLS
and SSH.

2/11/2025 148
How Elgamal works?

2/11/2025 149
How Elgamal works?

2/11/2025 150
Example of Elgamal ?

2/11/2025 151
Example of Elgamal ?

2/11/2025 152
Example of Elgamal ?

2/11/2025 153
Example of Elgamal ?

2/11/2025 154
Example of Elgamal ?

2/11/2025 155
ECC?

1. 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.
2. 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.
3. 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.
4. From a cryptographic perspective, the points along the graph can be formulated
using the following equation:
y²=x³ + ax + b

2/11/2025 156
ECC?

2/11/2025 157
ECC?

1. ECC is based on the properties of a set of values for which operations can be
performed on any two members of the group to produce a third member, which is
derived from points where the line intersects the axes as shown with the green line
and three blue dots in the below diagram labeled A, B and C.

2. Multiplying a point on the curve by a number produces another point on the curve
(C). Taking point C and bringing it to the mirrored point on the opposite side of the
x-axis produces point D. From here, a line is drawn back to our original point A,
creating an intersection at point E.

3. This process can be completed n number of times within a defined max value. The
n is the private key value, which indicates how many times the equation should be
run, ending on the final value that is used to encrypt and decrypt data.

4. The maximum defined value of the equation relates to the key size used.

2/11/2025 158
Digital signature?

1. Digital Signatures are an Asymmetrically encrypted hash of a digital


message(data).
2. It is a value that can provide a guarantee of authenticity, non-repudiation, and
integrity.
3. In other terms, it means you can verify the sender, date & time and message
content have not been revealed or compromised.

2/11/2025 159
Digital signature?
1. Digital Signatures are an Asymmetrically encrypted hash of a digital
message(data).
2. It is a value that can provide a guarantee of authenticity, non-repudiation, and
integrity.
3. In other terms, it means you can verify the sender, date & time and message
content have not been revealed or compromised.

2/11/2025 160
Digital signature?

Digital Signature Flow

1. Let “A” and “B” be the fictional actors in the cryptography system for better
understanding.
2. “A” is the sender and calculates the hash of the message and attaches signature
which he wants to send using his private key.
3. The other side “B” hashes the message and then decrypts the signature with A’s
public key and compares the two hashes
4. If “B” finds the hashes matching then the message has not been altered or
compromised.

2/11/2025 161
• Unit 2
Security Services: Authentication and Key Exchange
Protocols - Access control matrix – User authentication –
Directory authentication service – Diffie-Hellman key
exchange – Kerberos.
Unit 3
System security and Security models: Disaster recovery -
Protection policies. E-mail Security: Pretty good privacy
- Database Security: Integrity constraints - multi-phase
commit protocols - Networks Security: Threats in
networks - DS authentication -Web and Electronic
Commerce: Secure socket layer - Client-side certificates
- Trusted Systems: Memory protection

2/11/2025 162

You might also like