Information and Network Security-UNIT 1
Information and Network Security-UNIT 1
Security
UNIT 1
By Shivani Deopa
INTRODUCTION TO SECURITY
• A crucial component of network systems, information security works
to safeguard data and information from unwanted access, use,
disclosure, interruption, alteration, and destruction.
• The security of network systems is now more crucial than ever due to
society's growing reliance on digital technology and the internet.
What is Information Security in Network Systems?
• A combination of practices, policies, and procedures called
information security in network systems is intended to safeguard the
privacy, availability, and integrity of data and information stored,
processed, and sent across a network.
• It entails locating potential risks and vulnerabilities in network
systems, putting those risks under control, and continuously
assessing and enhancing the network's security posture.
Why Is Information Security Essential in Network Systems?
• Information security is essential in network systems for a number of reasons:
1. Protection of sensitive information: Network systems often store and transmit
sensitive information such as financial records, personal identifiable
information (PII), and intellectual property. The security of this information is
critical to protect the privacy and interests of individuals and organizations.
2. Compliance with regulations: Many industries are subject to regulations and
standards that require the implementation of specific security measures to
protect sensitive information. Failure to comply with these regulations can
result in legal and financial consequences.
3. Business continuity: Security breaches can cause disruptions to network
systems, resulting in downtime and lost productivity. By ensuring the security
of network systems, organizations can maintain business continuity and
minimize the impact of security incidents.
4. Reputation and trust: A security breach can damage an organization's
reputation and erode the trust of customers, partners, and stakeholders. By
prioritizing information security, organizations can build and maintain trust
with their stakeholders.
Key Techniques and Best Practices for Information Security in Network Systems
1. Access Control: Access control is the practice of restricting access to network resources to
authorized individuals or systems. This can be achieved through the use of passwords, multi-
factor authentication, and role-based access control (RBAC).
2. Encryption: Encryption is the process of converting plaintext data into ciphertext to protect it
from unauthorized access. Encryption is commonly used to secure data in transit, such as
email messages and web traffic, as well as data at rest, such as files stored on a server.
3. Firewalls: Firewalls are network security devices that monitor and control incoming and
outgoing network traffic based on predefined rules. Firewalls can be implemented at the
network or host level and are an effective way to protect against unauthorized access and
malicious traffic.
4. Intrusion Detection and Prevention: Intrusion detection and prevention systems (IDPS) are
security technologies that monitor network traffic for suspicious activity and can automatically
block or alert security personnel about potential security incidents.
5. Patch Management: Patch management is the practice of regularly updating software and
firmware to address security vulnerabilities and bugs. Timely patching is critical to maintaining
the security of network systems.
6. Employee Training and Awareness: Employees are often the weakest link in network security,
as they can inadvertently expose sensitive information or fall victim to social engineering
attacks. Regular training and awareness programs can help employees identify and prevent
security incidents.
Network security
• Network security has become increasingly important in the current digital era for maintaining the integrity
and safety of our networks. The protection of a computer network and its data from illegal access, theft, or
damage is referred to as network security. Security precautions must be taken in network systems to
protect the network from various forms of assaults, including malware, phishing, denial of service (DoS)
attacks, and more.
• The installation of firewalls is one of the crucial phases in network security. A firewall is a piece of hardware
or software that monitors and regulates network traffic, basing its actions on pre-set security rules. A
firewall can stop potentially hazardous traffic from entering the system and can stop unauthorized users
from accessing the network.
• The use of encryption is yet another crucial component of network security. Data is transformed into a
secret code via encryption to prevent unauthorized access. Sensitive information, like passwords, credit card
numbers, and other personal data, is frequently secured via encryption.
• Network security also entails the deployment of antivirus and anti-malware software in addition to firewalls
and encryption. These tools are made to identify and eliminate dangerous software from the network, such
as Trojan horses, worms, and viruses. Anti-malware software is essential for preventing hackers from
breaking into networks or stealing critical data.
• Monitoring and analyzing network traffic on a regular basis is another essential component of network
security. Network managers must keep an eye on network traffic for any unusually high volumes of traffic or
traffic coming from unidentified sources, among other signs of suspicious activity. Network traffic analysis
can be used to identify and stop attacks before they harm the network.
• Finally, network security is an important component of network systems. It entails using firewalls,
encryption, antivirus and anti-malware software, strong passwords, access control measures, routine
network traffic monitoring and analysis, and regular network device and software upgrades and patches.
Network administrators can defend the network against different assaults and guarantee the integrity and
safety of the network and its data by putting these security measures in place.
Difference between Network security Information security
Information security & Network security focuses on Information security is concerned with
protecting the network infrastructure safeguarding the data that resides on
Network security the network.
• Protecting sensitive Network security measures typically Information security measures include
information and computer include firewalls, intrusion detection encryption, access control, and
systems, and other tools designed to backup and recovery systems.
systems from online threats prevent unauthorized access to the
requires both network network.
security and information Network security is more concerned Information security is more
security. with the technical aspects of securing concerned with the policies and
a network, such as network procedures that govern how data is
• Despite their near architecture, protocols, and devices. accessed, used, and protected.
resemblance, the two have
some variances. The Network security is typically Information security is often the
following are some implemented by network engineers responsibility of dedicated security
important distinctions and administrators, professionals.
between network security Network security focuses on the Information security also includes
confidentiality, integrity, and additional aspects such as
and information security: availability of network resources. authenticity, accountability, and non-
repudiation.
Network security measures can be Information security measures are
implemented at the network typically implemented at the data
perimeter, such as firewalls and level, such as encryption and access
intrusion detection systems. controls.
The OSI Security Architecture
• The OSI (Open Systems Interconnection) Security Architecture defines
a systematic approach to providing security at each layer. It defines security
services and security mechanisms that can be used at each of the seven layers of
the OSI model to provide security for data transmitted over a network.
• These security services and mechanisms help to ensure the confidentiality,
integrity, and availability of the data. OSI architecture is internationally
acceptable as it lays the flow of providing safety in an organization.
• OSI Security Architecture focuses on these concepts:
1. Security Attack:
2. Security mechanism: A security mechanism is a means of protecting a system,
network, or device against unauthorized access, tampering, or other security
threats.
3. Security Service
Benefits of OSI Architecture:
Below listed are the benefits of OSI Architecture in an
organization:
1. Providing Security:
• OSI Architecture in an organization provides the needed
security and safety, preventing potential threats and risks.
• Managers can easily take care of the security and there is
hassle-free security maintenance done through OSI
Architecture.
2. Organising Task:
• The OSI architecture makes it easy for managers to build a
security model for the organization based on strong security
principles.
• Managers get the opportunity to organize tasks in an
organization effectively.
3. Meets International Standards:
• Security services are defined and recognized internationally
meeting international standards.
• The standard definition of requirements defined using OSI
Architecture is globally accepted.
Security Attacks
• A security attack is an attempt by a person or entity to gain
unauthorized access to disrupt or compromise the security of a
system, network, or device.
• These are defined as the actions that put at risk an organization’s
safety.
• They are further classified into 2 sub-categories:
A. Passive Attack
B. Active attack
Passive Attack:
• Attacks in which a third-party intruder tries to access the message/
content/ data being shared by the sender and receiver by keeping a close
watch on the transmission or eave-dropping the transmission is called
Passive Attacks.
• These types of attacks involve the attacker observing or monitoring
system, network, or device activity without actively disrupting or altering
it. Passive attacks are typically focused on gathering information or
intelligence, rather than causing damage or disruption.
• Here, both the sender and receiver have no clue that their message/ data
is accessible to some third-party intruder. The message/ data transmitted
remains in its usual form without any deviation from its usual behavior.
• This makes passive attacks very risky as there is no information provided
about the attack happening in the communication process.
• One way to prevent passive attacks is to encrypt the message/data that
needs to be transmitted, this will prevent third-party intruders to use the
information though it would be accessible to them.
• Passive attacks are further divided into two parts based on their
behavior:
1. Eavesdropping: This involves the attacker intercepting and listening
to communications between two or more parties without their
knowledge or consent. Eavesdropping can be performed using a
variety of techniques, such as packet sniffing, or man-in-the-middle
attacks.
2. Traffic analysis: This involves the attacker analyzing network traffic
patterns and metadata to gather information about the system,
network, or device. Here the intruder can’t read the message but
only understand the pattern and length of encryption. Traffic
analysis can be performed using a variety of techniques, such as
network flow analysis, or protocol analysis.
Active Attacks:
• Active attacks refer to types of attacks that involve the attacker
actively disrupting or altering system, network, or device activity.
• Active attacks are typically focused on causing damage or disruption,
rather than gathering information or intelligence. Here, both the
sender and receiver have no clue that their message/ data is modified
by some third-party intruder.
• The message/ data transmitted doesn’t remain in its usual form and
shows deviation from its usual behavior.
• This makes active attacks dangerous as there is no information
provided of the attack happening in the communication process and
the receiver is not aware that the data/ message received is not from
the sender.
• Active attacks are further divided into four parts based on their behavior:
1. Masquerade is a type of attack in which the attacker pretends to be an
authentic sender in order to gain unauthorized access to a system. This
type of attack can involve the attacker using stolen or forged credentials,
or manipulating authentication or authorization controls in some other
way.
2. Replay is a type of active attack in which the attacker intercepts a
transmitted message through a passive channel and then maliciously or
fraudulently replays or delays it at a later time.
3. Modification of Message involves the attacker modifying the
transmitted message and making the final message received by the
receiver look like it’s not safe or non-meaningful. This type of attack can
be used to manipulate the content of the message or to disrupt the
communication process.
4. Denial of service (DoS) attacks involve the attacker sending a large
volume of traffic to a system, network, or device in an attempt to
overwhelm it and make it unavailable to legitimate users.
Security Services
• Security services refer to the different services available for maintaining the security and
safety of an organization. They help in preventing any potential risks to security. Security
services are divided into 5 types:
• Authentication is the process of verifying the identity of a user or device in order to
grant or deny access to a system or device.
• Access control involves the use of policies and procedures to determine who is allowed
to access specific resources within a system.
• Data Confidentiality is responsible for the protection of information from being
accessed or disclosed to unauthorized parties.
• Data integrity is a security mechanism that involves the use of techniques to ensure that
data has not been tampered with or altered in any way during transmission or storage.
• Non- repudiation involves the use of techniques to create a verifiable record of the
origin and transmission of a message, which can be used to prevent the sender from
denying that they sent the message.
Security Mechanisms
• The mechanism that is built to identify any breach of security or
attack on the organization, is called a security mechanism.
• Security Mechanisms are also responsible for protecting a system,
network, or device against unauthorized access, tampering, or other
security threats.
• Security mechanisms can be implemented at various levels within a
system or network and can be used to provide different types of
security, such as confidentiality, integrity, or availability.
• Some examples of security mechanisms include:
• Encipherment (Encryption) involves the use of algorithms to transform
data into a form that can only be read by someone with the appropriate
decryption key. Encryption can be used to protect data it is transmitted
over a network, or to protect data when it is stored on a device.
• Digital signature is a security mechanism that involves the use of
cryptographic techniques to create a unique, verifiable identifier for a
digital document or message, which can be used to ensure the authenticity
and integrity of the document or message.
• Traffic padding is a technique used to add extra data to a network traffic
stream in an attempt to obscure the true content of the traffic and make it
more difficult to analyze.
• Routing control allows the selection of specific physically secure routes for
specific data transmission and enables routing changes, particularly when a
gap in security is suspected.
Classical Encryption Techniques
Symmetric Cipher Model
• Symmetric Encryption is the most basic and old method of
encryption. It uses only one key for the process of both the
encryption and decryption of data. Thus, it is also known as Single-
Key Encryption.
1. Plain Text (x): This is the original data/message that is to be communicated to the
receiver by the sender. It is one of the inputs to the encryption algorithm.
2. Secret Key (k): It is a value/string/text file used by the encryption and decryption
algorithm to encode and decode the plain text to cipher text and vice-versa
respectively. It is independent of the encryption algorithm. It governs all the
conversions in plain text. All the substitutions and transformations done depend on
the secret key.
3. Encryption Algorithm (E): It takes the plain text and the secret key as inputs and
produces Cipher Text as output. It implies several techniques such as substitutions and
transformations on the plain text using the secret key.
E(x, k) = y
4. Cipher Text (y): It is the formatted form of the plain text (x) which is unreadable for
humans, hence providing encryption during the transmission. It is completely
dependent upon the secret key provided to the encryption algorithm. Each unique
secret key produces a unique cipher text.
5. Decryption Algorithm (D): It performs reversal of the encryption algorithm at the
recipient’s side. It also takes the secret key as input and decodes the cipher text
received from the sender based on the secret key. It produces plain text as output.
D(y, k) = x
Requirements for Encryption:
• There are only two requirements that need to be met to perform
encryption. They are,
1. Encryption Algorithm: There is a need for a very strong encryption
algorithm that produces cipher texts in such a way that the attacker
should be unable to crack the secret key even if they have access to
one or more cipher texts.
2. Secure way to share Secret Key: There must be a secure and robust
way to share the secret key between the sender and the receiver. It
should be leak proof so that the attacker cannot access the secret
key.
Substitution Techniques
• In a Substitution cipher, any character of plain text from the given
fixed set of characters is substituted by some other character from
the same set depending on a key. For example with a shift of 1, A
would be replaced by B, B would become C, and so on.
• The following are some Substitution Cipher Techniques:
- Caesar Cipher
- Monoalphabetic Cipher
- Vernam Cipher
Caesar Cipher
• The Caesar cipher is a simple encryption technique that was used by Julius Caesar to
send secret messages to his allies. It works by shifting the letters in the plaintext
message by a certain number of positions, known as the “shift” or “key”.
• The Caesar Cipher technique is one of the earliest and simplest methods of encryption
technique.
• It’s simply a type of substitution cipher, i.e., each letter of a given text is replaced by a
letter with a fixed number of positions down the alphabet.
• For example with a shift of 1, A would be replaced by B, B would become C, and so on.
The method is apparently named after Julius Caesar, who apparently used it to
communicate with his officials.
• Thus to cipher a given text we need an integer value, known as a shift which indicates
the number of positions each letter of the text has been moved down.
• The encryption can be represented using modular arithmetic by first transforming the
letters into numbers, according to the scheme, A = 0, B = 1,…, Z = 25. Encryption of a
letter by a shift n can be described mathematically as.
• For example, if the shift is 3, then the letter A would be replaced by the letter D,
B would become E, C would become F, and so on. The alphabet is wrapped
around so that after Z, it starts back at A.
• Here is an example of how to use the Caesar cipher to encrypt the message
“HELLO” with a shift of 3:
• Replace each letter in the plaintext message with the letter that is three positions
to the right in the alphabet.
H becomes K (shift 3 from H)
E becomes H (shift 3 from E)
L becomes O (shift 3 from L)
L becomes O (shift 3 from L)
O becomes R (shift 3 from O)
• The encrypted message is now “KHOOR”.
• To decrypt the message, you simply need to shift each letter back by the same
number of positions. In this case, you would shift each letter in “KHOOR” back by
3 positions to get the original message, “HELLO”.
Monoalphabetic Cipher
• An alphabetic substitution is a substitution cipher where the letters
of the alphabet are replaced by others according to a 1-1
correspondence (a plain letter always corresponds to the same cipher
letter).
• The substitution is said to be monoalphabetic because it uses only
one alphabet, this alphabet is said to be disordered. How to encrypt
using an alphabetical substitution?
• The monoalphabetical substitution consists in using a mixed alphabet
(with the letters in an unusual order) and replacing the letters of the
alphabet normal by it.
• Example: NBAJYFOWLZMPXIKUVCDEGRQSTH is a totally random
alphabet with the 26 letters of the Latin alphabet.
• To understand, write the alphabet over the classic alphabet:
Plain alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Substitution alphabet: NBAJYFOWLZMPXIKUVCDEGRQSTH
Decryption
• To decipher it, the recipient has to work out the column lengths by dividing the message length
by the key length.
• Then, write the message out in columns again, then re-order the columns by reforming the key
word.
Steganography
• Simply put, steganography is the practice of “hiding in plain sight.”
Steganography encodes a secret message within another non-secret object in
such a manner as to make the message imperceptible to those who aren’t aware
of its presence.
• Of course, because of this secrecy, steganography generally requires the
recipient to be aware that a message is forthcoming.
• To understand the meaning of steganography, it’s important to know the origins
of the technique. The practice of steganography dates back to ancient Greece,
from which we also get the word itself: a combination of the Greek words
“steganos” (covered or concealed) and “graphein” (writing).
• For example, the Greek historian Herodotus wrote about how Spartan warriors
used steganography to conceal military intelligence from the enemy. The
Spartans would write messages on wood tablets and cover them with wax, hiding
the information in case the messenger was intercepted. The recipient could then
scrape off the wax and easily read the message.
• Steganography, cryptography, and obfuscation are three related terms; they all
refer to practices that make data more difficult to understand. However, these
words are not interchangeable — subtle yet crucial distinctions exist between
them.
• Below are the differences between steganography, cryptography, and
obfuscation:
• Cryptography attempts to encode a message, making it difficult or impossible for
anyone except the intended recipient to decrypt it. The encoding and decoding
process is accomplished using cryptographic keys that translate back and forth
between the true message and its encrypted version.
• Steganography attempts to hide a message within another object. Not only does
steganography seek to make this information harder to understand, but it also
seeks to conceal that a message is being sent in the first place.
• Obfuscation is any technique that prevents third parties from understanding a
message. For example, a program’s source code may be obfuscated by removing
the whitespace, making the message difficult for humans to read.
• Examples of Steganography
• Steganography has been in use for centuries. Basic physical forms of steganography include invisible ink that
can only be read by exposing it to heat and messages written under the postage stamps of an envelope.
• However, clever practitioners of steganography have developed a range of more sophisticated techniques
that work in various mediums. One example is a laser printer’s Machine Identification Code (MIC), a unique
identifier encoded on any printed document using tiny yellow dots that are invisible to the naked eye.
Secret messages can even use the letters of a crossword or the numbers of a sudoku puzzle.
• More recently, digital stenography has emerged as a practice with both legitimate and criminal uses. The
different algorithms in digital steganography include:
• Least significant bit (LSB): In the LSB algorithm, the least significant bit in each byte of a multimedia file
(e.g., an image or audio) is modified to convey a hidden message.
• Multi-access edge computing can also help save on bandwidth costs and improve security by processing
data locally instead of sending it over the network to central servers.
• Discrete Fourier transform (DFT): In the DFT algorithm, information is hidden inside a multimedia file using
the mathematical technique of discrete Fourier transformation.
• The good news for users of steganography is that they don’t have to code these algorithms from scratch.
Instead, different programming languages come with pre-built steganography libraries and frameworks. For
example, the Python Stegano module can hide messages within an image (PyPI), while the
ImageSteganography library does the same for C++ programmers (GitHub, 2022).
What Are the 5 Types of Steganography?
1. Text steganography
• Text steganography conceals a secret message inside a piece of text.
The simplest version of text steganography might use the first letter
in each sentence to form the hidden message. Other text
steganography techniques might include adding meaningful typos or
encoding information through punctuation.
2. Image steganography
• In image steganography, secret information is encoded within a
digital image. This technique relies on the fact that small changes in
image color or noise are very difficult to detect with the human eye.
For example, one image can be concealed within another by using the
least significant bits of each pixel in the image to represent the
hidden image instead.
3. Video steganography
• Video steganography is a more sophisticated version of image steganography
that can encode entire videos. Because digital videos are represented as a
sequence of consecutive images, each video frame can encode a separate image,
hiding a coherent video in plain sight.
4. Audio steganography
• Audio files, like images and videos, can be used to conceal information. One
simple form of audio steganography is “backmasking,” in which secret messages
are played backwards on a track (requiring the listener to play the entire track
backwards). More sophisticated techniques might involve the least significant
bits of each byte in the audio file, similar to image steganography.
5. Network steganography
• Last but not least, network steganography is a clever digital steganography
technique that hides information inside network traffic. For example, data can be
concealed within the TCP/IP headers or payloads of network packets. The sender
can even impart information based on the time between sending different
packets.
Block Cipher Principles
• Block ciphers are built in the Feistel cipher structure. Block cipher has a specific number
of rounds and keys for generating ciphertext. Block cipher is a type of encryption
algorithm that processes fixed-size blocks of data, usually 64 or 128 bits, to produce
ciphertext.
• The design of a block cipher involves several important principles to ensure the security
and efficiency of the algorithm. Some of these principles are:
• Number of Rounds – The number of Rounds is regularly considered in design criteria, it
just reflects the number of rounds to be suitable for an algorithm to make it more
complex, in DES we have 16 rounds ensuring it to be more secure while in AES we have
10 rounds which makes it more secure.
• Design of function F – The core part of the Feistel Block cipher structure is the Round
Function. The complexity of cryptanalysis can be derived from the Round function i.e.
the increasing level of complexity for the round function would be greatly contributing
to an increase in complexity. To increase the complexity of the round function, the
avalanche effect is also included in the round function, as the change of a single bit in
plain text would produce a mischievous output due to the presence of avalanche effect.
• Confusion and Diffusion: The cipher should provide confusion and
diffusion to make it difficult for an attacker to determine the relationship
between the plaintext and ciphertext. Confusion means that the ciphertext
should be a complex function of the key and plaintext, making it difficult to
guess the key. Diffusion means that a small change in the plaintext should
cause a significant change in the ciphertext, which makes it difficult to
analyze the encryption pattern.
• Key Size: The key size should be large enough to prevent brute-force
attacks. A larger key size means that there are more possible keys, making
it harder for an attacker to guess the correct one. A key size of 128 bits is
considered to be secure for most applications.
• Key Schedule: The key schedule should be designed carefully to ensure
that the keys used for encryption are independent and unpredictable. The
key schedule should also resist attacks that exploit weak keys or key-
dependent properties of the cipher.
• Block Size: The block size should be large enough to prevent attacks that
exploit statistical patterns in the plaintext. A block size of 128 bits is
generally considered to be secure for most applications.
• Non-linearity: The S-box used in the cipher should be non-linear to provide
confusion. A linear S-box is vulnerable to attacks that exploit the linear
properties of the cipher.
• Avalanche Effect: The cipher should exhibit the avalanche effect, which
means that a small change in the plaintext or key should cause a significant
change in the ciphertext. This ensures that any change in the input results
in a complete change in the output.
• Security Analysis: The cipher should be analyzed for its security against
various attacks such as differential cryptanalysis, linear cryptanalysis, and
brute-force attacks. The cipher should also be tested for its resistance to
implementation attacks, such as side-channel attacks.
The Data Encryption Standard
• Developed in early 1970’s at IBM and submitted to NBS. DES is
landmark in cryptographic algorithms.
• DES works based on Feistel Cipher Structure.
• DES is symmetric cipher algorithm and use block cipher method for
encryption and decryption.
Key Discarding Process
Steps of DES
Step – 1: 64-bit plain text block is given to Initial
Permutation (IP) function.
Step – 2: IP performed on 64-bit plain text block.
Step – 3: IP produced two halves of the
permuted block known as Left Plain Text (LPT)
and Right Plain Text (RPT).
Step – 4: Each LPT and RPT performed 16-rounds
of encryption process.
Step – 5: LPT and RPT rejoined and Final
Permutation (FP) is performed on combined
block.
Step – 6: 64-bit Cipher text block is generated.
Initial Permutation (IP) & Generate LPT -RPT
• Initial Permutation performed only once. Bit sequence have changed as
per IP table.
• For Example:
✔1st bit takes 40th Position,
✔58th bit take 1st position
• Output of IP is divided into two equal halves known as LPT, RPT. (LPT – 32
bits, RPT – 32 bit)
16 Rounds of Encryption
Step – 1: Key Transformation (56-bit key)
• Key Bit Shifted per round
• Compression Permutation
Step – 2: Expansion permutation of Plain Text
and X-OR (P.T. size: 48 bit, C.T. size: 48 bit)
Step – 3: S-box Substitution
Step – 4: P-box (Permutation)
Step – 5: X-OR and Swap.
Step – 1: Key Bit Shifted per Round
• 56-bit key is divided into two halves each of 28-bits.
• Circular left shift is performed on each half.
• Shifting of Bit position is depending on round.
• For round number 1,2,9 and 16 shifts are done by one position.
• For remaining rounds shift is done by 2 positions.
Compression Permutation
• 56-bit input with bit shifting position
• Generates 48-bit key (Compression of Key bit)
• Drop 9, 18, 22, 25, 35, 38, 43 and 54 bits.
• Generated 48 bits keys are as below:
Step – 2: Expansion Permutation and X-OR
• 32-bit RPT of IP is expanded to 48-bits
• Expansion permutation steps:
• 32-bit RPT is divided into 8-blocks each of 4-bits
• 48-bit RPT is XORed with 48-bit Key and output is given to S-Box.
Step – 3: S-BOX Substitution
Step -4: P-BOX Permutation
• Output of s-box is given to p-box
• 32-bit is permuted with 16 x 2 permutation table
• For Example: 16th bit of S-box takes 1st Position as per below
permutation table.
Step – 5: XOR and SWAP
• 32-bit LPT is XORed with 32-bit p-box.
• The output of the final permutation is the 64-bit encrypted block (64-
bit cipher text block).
Strength of DES
• Key Length (Use of 56-bit Key): 256 Possible Keys (7.2 x 1016 Keys), Brute force attack
takes more than thousand Years
• Use of S-boxes: Complex Structure of S-box, Scope of attack is very less
• DES is Reversible algorithm
Weakness of DES
• Trying all 256 possible keys are not much harder these days. If you spend at least $25 K
you can build DES password crackers that will successes in few hours.
• Two chosen input to an S-box can create the same output.
• The purpose of initial and final permutation is not clear.
Key Takeaways
• Public key cryptosystem is one which involves two separate keys for encryption and decryption.
• Each user participating in the communication has to generate two keys, one is to be kept secret (private
key) and one is to make public (public key).
• Public key cryptosystem can achieve both confidentiality and authenticity.
• The public key cryptosystem is based on invertible mathematics so it has too much of computation.
• Large key size reduces the probability of brute force attack in public key cryptosystem
• Examples of public key cryptosystem are RSA, Diffie-Hellman, DSS and Elliptic curve.
The RSA Algorithm
• RSA encryption algorithm is a type of public-key encryption algorithm. To
better understand RSA, lets first understand what is public-key encryption
algorithm.
• Each sender is assigned a pair of keys:
1. Public key
2. Private key
• The Public key is used for encryption, and the Private Key is used for
decryption.
• Decryption cannot be done using a public key. The two keys are linked, but the
private key cannot be derived from the public key. The public key is well
known, but the private key is secret and it is known only to the user who owns
the key.
• It means that everybody can send a message to the user using user's public key.
But only the user can decrypt the message using his private key.
• The Public key algorithm operates in the following manner:
1. The data to be sent is encrypted by sender A using the public key
of the intended receiver
2. B decrypts the received ciphertext using its private key, which is
known only to B. B replies to A encrypting its message using A's
public key.
3. A decrypts the received ciphertext using its private key, which is
known only to him.
RSA encryption algorithm:
• RSA is the most common public-key algorithm, named after its
inventors Rivest, Shamir, and Adelman (RSA).
RSA algorithm uses the following procedure to generate public and private keys:
• Select two large prime numbers, p and q.
• Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption.
• Choose a number e less than n, such that n is relatively prime to (p - 1) x (q -1). It means that e and (p - 1)
x (q - 1) have no common factor except 1. Choose "e" such that 1<e < φ (n), e is prime to φ (n),
gcd (e,d(n)) =1
• If n = p x q, then the public key is <e, n>. A plaintext message m is encrypted using public key <e, n>. To
find ciphertext from the plain text following formula is used to get ciphertext C.
C = me mod n
• Here, m must be less than n. A larger message (>n) is treated as a concatenation of messages, each of
which is encrypted separately.
• To determine the private key, we use the following formula to calculate the d such that:
De mod {(p - 1) x (q - 1)} = 1
Or
De mod φ (n) = 1
• The private key is <d, n>. A ciphertext message c is decrypted using private key <d, n>. To calculate plain
text m from the ciphertext c following formula is used to get plain text m.
m = cd mod n
Example 1:
• This example shows how we can encrypt plaintext 9 using the RSA public-key encryption
algorithm. This example uses prime numbers 7 and 11 to generate the public and private keys.
Explanation:
Step 1: Select two large prime numbers, p, and q.
p = 7 q = 11
Step 2: Multiply these numbers to find n = p x q, where n is called the modulus for encryption and
decryption.
First, we calculate
n = p x q = 7 x 11 = 77
Step 3: Choose a number e less that n, such that n is relatively prime to (p - 1) x (q -1). It means
that e and (p - 1) x (q - 1) have no common factor except 1. Choose "e" such that 1<e < φ (n), e is
prime to φ (n), gcd (e, d (n)) =1.
Second, we calculate
φ (n) = (p - 1) x (q-1)
φ (n) = (7 - 1) x (11 - 1) = 6 x 10 = 60
Let us now choose relative prime e of 60 as 7.
Thus the public key is <e, n> = (7, 77)
Step 4: A plaintext message m is encrypted using public key <e, n>. To find ciphertext
from the plain text following formula is used to get ciphertext C.
To find ciphertext from the plain text following formula is used to get ciphertext C.
C = me mod n
C = 97 mod 77 = 37
Step 5: The private key is <d, n>. To determine the private key, we use the following
formula d such that:
de mod {(p - 1) x (q - 1)} = 1
7d mod 60 = 1, which gives d = 43
The private key is <d, n> = (43, 77)
Step 6: A ciphertext message C is decrypted using private key <d, n>. To calculate plain
text m from the ciphertext c following formula is used to get plain text m.
m = Cd mod n
m = 3743 mod 77 = 9
In this example, Plain text = 9 and the ciphertext = 37
Example 2:
• In an RSA cryptosystem, a particular A uses two prime numbers, 13 and 17, to generate the public and
private keys. If the public of A is 35. Then the private key of A is ……………?.
Explanation:
Step 1: in the first step, select two large prime numbers, p and q.
p = 13 q = 17
Step 2: Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption.
First, we calculate
n=pxq
n = 13 x 17 = 221
Step 3: Choose a number e less that n, such that n is relatively prime to (p - 1) x (q -1). It means that e and (p -
1) x (q - 1) have no common factor except 1. Choose "e" such that 1<e < φ (n), e is prime to φ (n), gcd (e, d
(n)) =1.
Second, we calculate
φ (n) = (p - 1) x (q-1)
φ (n) = (13 - 1) x (17 - 1)
φ (n) = 12 x 16 = 192
g.c.d (35, 192) = 1
Step 4: To determine the private key, we use the following formula to calculate the d such that:
Calculate d = de mod φ (n) = 1
d = d x 35 mod 192 = 1
d = (1 + k.φ (n))/e [let k =0, 1, 2, 3………………]
Put k = 0
d = (1 + 0 x 192)/35
d = 1/35
Put k = 1
d = (1 + 1 x 192)/35
d = 193/35
Put k = 2
d = (1 + 2 x 192)/35
d = 385/35 = 11
The private key is <d, n> = (11, 221)
Hence, private key i.e. d = 11
Example 3:
• A RSA cryptosystem uses two prime numbers 3 and 13 to generate the public key= 3 and the private key =
7. What is the value of cipher text for a plain text?
Explanation:
Step 1: In the first step, select two large prime numbers, p and q.
p=3 q = 13
Step 2: Multiply these numbers to find n = p x q, where n is called the modulus for encryption and decryption.
First, we calculate
n = p x q = 3 x 13 = 39
Step 3: If n = p x q, then the public key is <e, n>. A plaintext message m is encrypted using public key <e, n>.
Thus the public key is <e, n> = (3, 39).
To find ciphertext from the plain text following formula is used to get ciphertext C.
C = me mod n
C = 53 mod 39
C = 125 mod 39
C=8
Hence, the ciphertext generated from plain text, C = 8.
Example 4:
• A RSA cryptosystem uses two prime numbers, 3 and 11, to generate private key = 7. What is
the value of ciphertext for a plain text 5 using the RSA public-key encryption algorithm?
Explanation:
Step 1: in the first step, select two large prime numbers, p and q.
p = 3 q = 11
Step 2: Multiply these numbers to find n = p x q, where n is called the modulus for encryption and
decryption.
First, we calculate
n = p x q = 3 x 11 = 33
Step 3: Choose a number e less that n, such that n is relatively prime to (p - 1) x (q -1). It means
that e and (p - 1) x (q - 1) have no common factor except 1. Choose "e" such that 1< e < φ (n), e is
prime to φ (n), gcd (e, d (n)) =1.
Second, we calculate
φ (n) = (p - 1) x (q-1)
= (3 - 1) x (11 - 1)
= 2 x 10 = 20
Step 4: To determine the public key, we use the following formula to calculate the
d such that:
Calculate e x d = 1 mod φ (n)
e x 7 = 1 mod 20
e = (1 + k. φ (n))/ d) [let k =0, 1, 2, 3………………]
Put k = 0
e = (1 + 0 x 20) / 7
= 1/7
Put k = 1
e = (1 + 1 x 20) / 7
= 21/7
=3
The public key is <e, n> = (3, 33)
Hence, public key i.e. e = 3