0% found this document useful (0 votes)
25 views117 pages

Network Security

The document provides an overview of cryptography, detailing its terminology, features, and various algorithms used for securing communication. It distinguishes between symmetric and asymmetric encryption, explains the importance of authentication, integrity, and non-repudiation, and discusses cryptanalysis and steganography. Additionally, it outlines different types of ciphers and the One Time Pad algorithm, emphasizing the significance of key management in cryptographic systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views117 pages

Network Security

The document provides an overview of cryptography, detailing its terminology, features, and various algorithms used for securing communication. It distinguishes between symmetric and asymmetric encryption, explains the importance of authentication, integrity, and non-repudiation, and discusses cryptanalysis and steganography. Additionally, it outlines different types of ciphers and the One Time Pad algorithm, emphasizing the significance of key management in cryptographic systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 117

NETWORK

SECURITY
UNIT-1 CRYPTOGRAPHY TERMINOLOGY
CRYPTOGRAPHY
 It can reformat and transform our data, making
it safer on its trip between computers.
 It is a technique of securing communication by
converting plain text into ciphertext
 The technology is based on the essentials of
secret codes, augmented by modern
mathematics that protects our data in powerful
ways.
• Computer Security - generic name for the
collection of tools designed to protect data and
to thwart hackers
• Network Security - measures to protect data
during their transmission
• Internet Security - measures to protect data
during their transmission over a collection of
interconnected networks
BASIC CONCEPTS
 Cryptography -The art or science encompassing the principles and methods of transforming
an intelligible message into one that is unintelligible, and then retransforming that message
back to its original form
 Plaintext -The original intelligible message
 Cipher text -The transformed message
 Cipher- An algorithm for transforming an intelligible message into one that is unintelligible by
transposition and/or substitution methods
 Key- Some critical information used by the cipher, known only to the sender& receiver
 Encipher (encode) -The process of converting plaintext to cipher text using a cipher and a key
 Decipher (decode)- the process of converting cipher text back into plaintext using a cipher
and a key
 Cryptanalysis -The study of principles and methods of transforming an unintelligible message
back into an intelligible message without knowledge of the key. Also called code breaking
 Cryptology- Both cryptography and cryptanalysis
 Code - An algorithm for transforming an intelligible message into an unintelligible one using a
code-book
FEATURES OF CRYPTOGRAPHY

• Confidentiality: Information can only be accessed by the person for whom it is intended and no
other person except him can access it.

• Integrity: Information cannot be modified in storage or transition between sender and intended
receiver without any addition to information being detected.

• Non-repudiation: The creator/sender of information cannot deny his intention to send information
at a later stage.

• Authentication: The identities of the sender and receiver are confirmed. As well destination/origin
of the information is confirmed.

• Interoperability: Cryptography allows for secure communication between different systems and
platforms.

• Adaptability: Cryptography continuously evolves to stay ahead of security threats and


technological advancements.
In mathematical notation, (E = Encryption Function, Operates on M , Produces C Output

E(M) = C
In reverse process,

D(C) = M
The full process

D(E(M)) = M
AUTHENTICATION , INTEGRITY AND NON-REPUDIATION

 Authentication: Ensures that the origin of a message or electronic document is


correctly identified, with an assurance that the identity is not false.
 Integrity: Ensures that only authorized parties are able to modify computer system
assets and transmitted information. Modification includes writing, changing status,
deleting, creating and delaying or replaying of transmitted messages.
 Non repudiation: Requires that neither the sender nor the receiver of a message
be able to deny the transmission.
ALGORITHM AND KEYS
 A cryptographic algorithm is a set of steps that can be used to convert plain text into cipher text. A
cryptographic algorithm is also known as an encryption algorithm.
 A cryptographic algorithm uses an encryption key to hide the information and convert it into an
unreadable format. Similarly, a decryption key can be used to convert it back into plain-readable
text.
 Function for cryptographic algorithm is: (k = key and range of possible values of key = key space)

EK(M) = C and DK(C) = M then

DK (EK(M)) = M
Scenarios where algorithms or cryptographic techniques
might be restricted
Export restrictions: These restrictions are imposed by various governments due to
national Security concerns to strength of encryption that could be exported to certain
countries.

Government Regulations: The government restricts the use of certain cryptographic


techniques or algorithms in specific industries or applications. For example, in the financial
sector or healthcare industry, there may be regulations specifying the use of particular
encryption standards.

Security Policies: Within organizations, there may be security policies or guidelines that
restrict the use of certain cryptographic algorithms or require the use of specific approved
algorithms to maintain a consistent and secure cryptographic environment.

Cryptographic Export Controls: In some cases, governments may impose controls on


the export of cryptographic algorithms and technologies to prevent them from falling into
the wrong hands.

Key Length Restrictions: Some standards and regulations specify minimum key lengths
Some algorithm use different encryption key and decryption key.

When keys are different then


EK1(M) = C and DK2(C) = M hence DK2 EK1(M) = C
SYMMETRIC ALGORITHM
 It is an encryption system where the sender and receiver of a message use a single common key to
encrypt and decrypt messages.
 Symmetric Key cryptography is faster and simpler but the problem is that the sender and
receiver have to somehow exchange keys securely.
 The most popular symmetric key cryptography systems are Data Encryption Systems (DES)
and Advanced Encryption Systems (AES) .
ASYMMETRIC ALGORITHM / PUBLIC KEY ALGORITHM
 In Asymmetric Key Cryptography, a pair of keys is used to encrypt and decrypt
information.
 A sender’s public key is used for encryption and a receiver’s private key is used for
decryption. Public keys and Private keys are different.
 Even if the public key is known by everyone the intended receiver can only decode it
because he alone knows his private key.
 The most popular asymmetric key cryptography algorithm is the RSA algorithm.
Difference Between Symmetric and Asymmetric Key
Encryption
Symmetric Key Encryption Asymmetric Key Encryption
It requires two keys, a public key and a private key, one to
It only requires a single key for both encryption and decryption.
encrypt and the other to decrypt.
The size of ciphertext is the same or smaller than the original The size of ciphertext is the same or larger than the original
plaintext. plaintext.
The encryption process is very fast. The encryption process is slow.

It is used when a large amount of data needs to be transferred. It is used to transfer small amount of data.

It only provides confidentiality. It provides confidentiality, authenticity, and non-repudiation.

The length of key used is 128 or 256 bits The length of key used is 2048 or higher

In symmetric key encryption, resource utilization is low compared


In asymmetric key encryption, resource utilization is high.
to asymmetric key encryption.
It is comparatively less efficient as it can handle a small amount
It is efficient as it is used for handling large amount of data.
of data.
Security is lower as only one key is used for both encryption and Security is higher as two keys are used, one for encryption and
decryption purposes. the other for decryption.
The Mathematical Representation is as follows = D(Kd, E (Ke,P))
The Mathematical Representation is as follows P = D (K, E(K, P))
where Ke –> encryption key
where K –> encryption and decryption key
Kd –> decryption key
P –> plain text
D –> Decryption
D –> Decryption
E(Ke, P) –> Encryption of plain text using encryption key Ke. P –>
E(K, P) –> Encryption of plain text using K
plain text
Cryptanalysis

 Cryptography which focuses on creating secret codes and


 Cryptanalysis which is the study of the cryptographic algorithm and the breaking of those
secret codes.
 The person practicing Cryptanalysis is called a Cryptanalyst.
 It helps us to better understand the cryptosystems and also helps us improve the system by
finding any weak point and thus work on the algorithm to create a more secure secret code
Cryptanalytic attacks
 To determine the weak points of a cryptographic system, it is important to attack the system. This
attacks are called Cryptanalytic attacks.
 Ciphertext-Only Analysis (COA) : In this type of attack, only some cipher-text is known and the
attacker tries to find the corresponding encryption key and plaintext. Its the hardest to implement
but is the most probable attack as only ciphertext is required.
 Known-Plaintext Analysis (KPA) : In this type of attack, some plaintext-ciphertext pairs are
already known. Attacker maps them in order to find the encryption key. This attack is easier to use
as a lot of information is already available.
 Chosen-Plaintext Analysis (CPA) : In this type of attack, the attacker chooses random
plaintexts and obtains the corresponding ciphertexts and tries to find the encryption key. Its very
simple to implement like KPA but the success rate is quite low.
 Adaptive Chosen-Plaintext Analysis (ACPA) : This attack is similar CPA. Here, the attacker
requests the cipher texts of additional plaintexts after they have ciphertexts for some texts.
Stenography
• It involves caching of secret information.
• we can hide any digital thing like textbook, image, videotape, etc behind a medium.

Different Types of Steganography


• Text Steganography- steganography which involves caching dispatches or secret information
within a textbook document or other textual data. In this system, we try to hide secret data with
the help of each letter of the word. It is challenging to describe especially when the variations or
changes made are subtle.

• Image Steganography-steganography which involves caching dispatches or secret information


within digital images. It is achieved by making changes in the pixels of the image to render the
information. It is generally used for watermarking, covert communication, brand protection, etc.

• Audio Steganography-steganography which involves caching dispatches or secret information


within audio lines. The ideal behind using this fashion is to hide information in such a way that
people cannot notice it when they hear the audio. It's generally used for digital rights operation in
audio lines.

• Video Steganography-steganography which involves caching dispatches or secret information


within digital videotape lines. The ideal way to use Video Steganography is to detect secret
information in a videotape in such a way that normal people won't notice it.

• Network or Protocol Steganography- steganography which involves caching dispatches or


Difference between Steganography and Cryptography

Steganography Cryptography

Steganography is defined as a system of Cryptography is defined as the system of


concealing data or information underknown-secret guarding information and communication with the
data or training. help of colorful ways.

Its main purpose is to maintain communication


Its main ideal is to give data protection.
security.

The structure of data is not modified in the case The structure of data is modified in the case of
of Steganography. Cryptography.

It is less popular. It is further popular.

The use of key is not obligatory, but if it is used it The use of key is obligatory in the case of
enhances security. Cryptography.

But, in Cryptography, there is use of fine


In Steganography, the use of fine metamorphoses
metamorphoses to play with the data and
is not involved importantly.
increase protection.
Substitution Cipher
Substitution ciphers involve replacing each member of the plaintext with another member which can
be of the same set. One of the early examples of the substitution technique is the Caesar cipher that
got its name from Julius Caesar, who allegedly employed it in his secret letters.
Caesar Cipher
The Caesar cipher is a substitution cipher where each letter in the plaintext is replaced by another
letter shifted a fixed number of positions down the alphabet.
Simple Substitution Cipher
A simple substitution cipher is a technique in which each letter in the plain text is replaced with
another letter. The key is the alphabet but in a random order.
Mono-alphabetic Cipher
A monoalphabetic cipher is a substitution cipher where a symbol in the plaintext
has a one-to-one relationship with a symbol in the ciphertext.
➢ It means that a symbol in the plaintext is always replaced with the same
symbol in theciphertext, irrespective of its position in the plaintext.
➢ It uses random substitution.
➢ This means that in a given plain-text message, each A can be replaced by any other
alphabet(B through Z), each B can also be replaced by any other random alphabet (A
or C throughZ), and so on. The crucial difference being, there is no relation between
the replacement ofB and replacement of A. That is, if we have decided to replace each
A with D, we need notnecessarily replace each B with E—we can replace each B with
any other character!

Homophonic Substitution Cipher


➢ This substitution cipher is very similar to mono-alphabetic cipher.
➢ However, the difference between the two techniques is in homophonic
substitution cipher, one plain-text alphabet can map to more than one cipher-text
alphabet.
➢ For instance, A can be replaced by <D, H, P, R>; B can be replaced by <E, I, Q, S>
etc
Polygram Substitution Cipher
➢ Polygram substitution cipher technique replaces one block of plain text with another
block of cipher text—it does not work on a character-by-character basis.
➢ For instance, HELLO could be replaced by YUQQW, but HELL could be replaced by a
totally different cipher text block TEUI,as shown in Fig.
➢ This is true in spite of the first four characters of the two blocks of text (HELL) being the
same. This shows that in the polygram substitution cipher, the replacement of plain text
happens block by block, rather than character by character.

Polyalphabetic Substitution Cipher


➢ Leon Battista invented the polyalphabetic substitution cipher in 1568.
➢ This cipher uses multiple one-character keys. Each of the keys encrypts one plaintext
character. The first key encrypts the first plain-text character; the second key
encrypts the second plain-text character, and so on.
➢ After all the keys are used, they are recycled. Thus, if we have 30 one-letter
keys, every 30th character in the plain text would be replaced with the same key
One Time Pad Algorithm
One Time Pad algorithm is the improvement of the Vernam Cipher, proposed by An Army Signal Corp
officer, Joseph Mauborgne. It is the only available algorithm that is unbreakable(completely secure).
It is a method of encrypting alphabetic plain text. It is one of the Substitution techniques which
converts plain text into ciphertext. In this mechanism, we assign a number to each character of the
Plain-Text.
The two requirements for the One-Time pad are
• The key should be randomly generated as long as the size of the message.
• The key is to be used to encrypt and decrypt a single message, and then it is discarded.
So encrypting every new message requires a new key of the same length as the new message in
one-time pad.

The ciphertext generated by the One-Time pad is random, so it does not have any statistical relation
with the plain text.
TheA assignmentB
is as follows:
C D E F G H I J
The relation between the key and plain text: In this algorithm, the length of the key should be
equal
0 to that of
1 plain text.
2 3 4 5 6 7 8 9

K L M N O P Q R S T

10 11 12 13 14 15 16 17 18 19

U V W X Y Z

20 21 22 23 24 25
Input: Message = HELLO,
Key = MONEY
Output: Cipher – TSYPM, Message – HELLO

Explanation:
Part 1: Plain text to Ciphertext
Plain text — H E L L O ? 7 4 11 11 14
Key — M O N E Y ? 12 14 13 4 24
Plain text + key ? 19 18 24 15 38 ? 19 18 24 15 12 (= 38 – 26)
Cipher Text ? T S Y P M

Part 2: Ciphertext to Message


Cipher Text — T S Y P M ? 19 18 24 15 12
Key — M O N E Y? 12 14 13 4 24
Cipher text – key ? 7 4 11 11 -12 ? 7 4 11 11 14
Message ? H E L L O Input: Message = SAVE, Key = LIFE
Output: Cipher – DIAI Message – SAVE
Security of One-Time Pad

If any way cryptanalyst finds these two keys using which two plaintext are produced but if the
key was produced randomly, then the cryptanalyst cannot find which key is more likely than the
other. In fact, for any plaintext as the size of ciphertext, a key exists that produces that plaintext.
So if a cryptanalyst tries the brute force attack(try using all possible keys), he would end up with
many legitimate plaintexts, with no way of knowing which plaintext is legitimate. Therefore, the
code is unbreakable.
The security of the one-time pad entirely depends on the randomness of the key. If the
characters of the key are truly random, then the characters of the ciphertext will be truly
random. Thus, there are no patterns or regularities that a cryptanalyst can use to attack the
ciphertext.

Advantages

One-Time Pad is the only algorithm that is truly unbreakable and can be used for low-bandwidth
channels requiring very high security(ex. for military uses).
A cryptographic protocol is a set of rules and procedures that use cryptographic
algorithms to achieve specific security objectives in communication and data exchange. These
protocols ensure confidentiality, integrity, and authentication in various digital interactions.

The primary purposes of cryptographic protocols include:


• Confidentiality: Ensuring that only authorized parties can access the information
• Integrity: Guaranteeing that the information has not been altered during transmission
• Authentication: Verifying the identity of the parties involved in the communication
• Non-repudiation: Preventing parties from denying their involvement in a transaction
Components of Cryptographic Protocols

Cryptographic protocols typically consist of several key components:

• Cryptographic algorithms: Mathematical functions used for encryption, decryption, and


hashing
• Keys: Secret values used in conjunction with cryptographic algorithms
• Initialization vectors: Random values used to add randomness to encryption processes
• Digital signatures: Mathematical schemes used to verify the authenticity of digital messages
or documents
• Certificates: Digital documents that bind a public key to an entity’s identity
How Cryptographic Protocols Work
Cryptographic protocols operate by combining various cryptographic primitives and techniques
to achieve their security objectives. Here’s a simplified overview of how a typical protocol might
work:

• Initialization: The parties involved agree on the protocol and necessary parameters.
• Key exchange: A secure method is used to exchange encryption keys.
• Authentication: The identities of the parties are verified.
• Encryption: Data is encrypted using the agreed-upon algorithms and keys.
• Transmission: The encrypted data is sent over the network.
• Decryption: The recipient decrypts the data using their key.
• Verification: The integrity and authenticity of the received data are checked.
Types of protocols
A) Arbitrated protocols
B. Adjudicated protocols
C. Self enforcing
Attacks on protocols

• Passive attacks
• Active attacks
• Cheaters
1. Symmetric cryptosystems (DES etc.)
2.
3. Security should lie in the key
4. Keys must be distributed in secret, and are as valuable as all the information they
encrypt.
5. Having a key compromised (broken, stolen, extorted, bribed) permits all sorts of mayhem
through messages read, and messages faked,
• N users need O(n^2) keys to communicate securely.
2. One-way functions

Functions that are easy to compute, but hard to invert.


Lots of proposed one-way functions, many do seem hard to invert, but there are lots of
examples of ideas that looked good and were later broken.
• No proof that any actually exist.

3. Trap-door one-way functions

Functions those are one-way, unless one knows the secret that allows them to be inverted.
Such functions are at the heart of public key systems such as RSA
Difficulty of factoring, discrete logs, various NP complete problems has been used as a basis
for trapdoor functions.
Again, no mathematical proof that such functions actually exist.
One-way functions
It easy to compute, whereas inverse functions are complicated to compute.
There is no mathematical proof that one-way functions exist.
The existence of such one-way functions is still a not-resolved question.
How Do One Way Functions Work?
A one-way function mainly starts with a group of letters known as a key,
which is then mapped to a hash of a specific length.
Modern hashes have 128 bits or more, however, the hash value is
shorter than the original string of characters.
The hash value is often referred to as a
message digest
. When you scramble this message digest, it becomes unique each time.
A one-way function should be free of collisions. This means it should be
extremely difficult to locate two distinct sequences that give the same
hash result.
Furthermore, one-way functions are used to store data. Data can be
accessed by locating hash values, and are stored in computer memory.
Public key cryptography
• It provides a secure way to exchange information and authenticate users by using pairs of
keys.
• The public key is used for encryption and signature verification, while the private key is
used for decryption and signing.
• When the two parties communicate with each other to transfer the intelligible or sensible
message, referred to as plaintext, is converted into apparently random unreadable for
security purposes referred to as ciphertext.
Components of Public Key Encryption
Plain Text: This is the message which is readable or
understandable. This message is given to the Encryption
algorithm as an input.
Cipher Text: The cipher text is produced as an output of
Encryption algorithm. We cannot simply understand this
message.
Encryption Algorithm: The encryption algorithm is used to
convert plain text into cipher text.
Decryption Algorithm: It accepts the cipher text as input and
the matching key (Private Key or Public key) and produces the
original plain text
Public and Private Key: One key either Private key (Secret
key) or Public Key (known to everyone) is used for encryption
and other is used for decryption
Hybrid Cryptosystem
It is a cryptographic system that combines the strengths of both symmetric and asymmetric
encryption. It leverages the high speed of symmetric encryption and the secure key distribution
of asymmetric encryption. Hybrid cryptosystems are widely used in real-world applications, such
as SSL/TLS protocols for secure communication.
Components of a Hybrid Cryptosystem
Symmetric Encryption:
Uses a single key for both encryption and decryption.
Fast and suitable for encrypting large amounts of data.
Example: AES (Advanced Encryption Standard).
Asymmetric Encryption:
Uses a pair of keys (public and private).
Secure key distribution but slower compared to symmetric encryption.
Example: RSA
Key Exchange:
A process where a symmetric key is securely shared using asymmetric encryption.
How a Hybrid Cryptosystem Works
Sender:
Generates a random symmetric key (called a session key).
Encrypts the data using the symmetric key (fast encryption).
Encrypts the symmetric key using the receiver’s public key (secure key exchange).
Receiver:
Decrypts the symmetric key using their private key.
Uses the symmetric key to decrypt the actual data.
Digital Signature
A digital signature is a cryptographic technique used to ensure the authenticity,
integrity, and non-repudiation of digital data. It verifies that a message, document,
or transaction originates from the claimed sender and has not been altered during
transmission.
Key Features
Authentication: Confirms the sender’s identity.
Integrity: Ensures the message has not been tampered with.
Non-repudiation: Prevents the sender from denying the act of signing.
How Digital Signatures Work
Key Generation:
A key pair (private key and public key) is created.
Private Key: Used to sign the message.
Public Key: Used to verify the signature.
Signing Process:
The sender creates a hash (a fixed-length string) of the message using a cryptographic hash
function.
The hash is encrypted with the sender’s private key, creating the digital signature.
Verification Process:
The recipient decrypts the digital signature using the sender’s public key, obtaining the hash.
The recipient computes the hash of the received message and compares it with the decrypted
hash.
Alice signs a message—"Hello Bob!"—by appending a signature computed from the
message and her private key. Bob receives both the message and signature. He
uses Alice's public key to verify the authenticity of the signed message.
Now, suppose when Alice sends a message to Bob, then Bob will check if the sender is authentic;
to ensure that it was Alice who sent the message, not Eve. For this, Bob can ask Alice to sign the
message electronically. So we can say that an electronic signature can prove that Alice is
authentic and is the one sending the message. We called this type of signature a digital signature.
DSA algorithm
The Digital Signature Algorithm (DSA) is a cryptographic
algorithm used to generate and verify digital signatures. It
ensures the integrity and authenticity of digital data and is
widely used in securing communications. Here’s an
explanation of its key concepts and workings:
Key Concepts of DSA:
Asymmetric Cryptography:
DSA uses two keys:
A private key: Known only to the owner and used to generate the digital signature.
A public key: Shared with others and used to verify the signature.
Digital Signature:
A unique cryptographic code that binds the signer’s identity to the document or message.
Ensures that the message has not been tampered with and confirms the sender’s authenticity.

Applications of DSA:
Data Integrity: Ensures the content of the message hasn’t been altered during transmission.
Authentication: Confirms the identity of the sender.
The image above shows the entire procedure of the DSA algorithm. You will use two
different functions here, a signing function and a verification function. The difference
between the image of a typical digital signature verification process and the one above is
the encryption and decryption part.
Digital Signature Algorithm & Digital Signature Standards
The National Institute of Standards and Technology (NIST) has published Federal Information Processing
Standard FIPS 186, known as the Digital Signature Standard (DSS). The DSS makes use of the SHA and presents a
new digital signature technique, the Digital Signature Algorithm (DSA). Latest version also incorporates digital
signature algorithms based on RSA and on elliptic curve cryptography.
The RSA Approach
• In the RSA approach, the message to be signed is input to a hash function(SHA-512 , SHA-1)
that produces a secure hash code of fixed length.
• This hash code is then encrypted using the sender’s private key to form the signature.
• Both the message and the signature are then transmitted.
• The recipient takes the message and produces a hash code.
• The recipient also decrypts the signature using the sender’s public key.
• If the calculated hash code matches the decrypted signature, the signature is accepted as
valid.
The DSS Approach
• The DSS approach also makes use of a hash function.
• The hash code is provided as input to a signature function along with a random number k,
generated for this particular signature.
• The signature function also depends on the sender’s private key (PRa), and a set of
parameters known to a group of communicating principle.
• We can consider this set to constitute a global public key (PUG).
• The result is a signature consisting of two components, labelled s and r.
• At the receiving end, the hash code of the incoming message is generated.
• The signature is input to a verification function. The verification function also depends on the
global public key as well as the sender’s public key (PUa), which is paired with the sender’s
private key.
• The output of the verification function is a value that is equal to the signature component r, if
the signature is valid. The signature function is such that only the sender, with knowledge of
the private key, could have produced the valid signature.
Digital Signature Algorithm
Create digital Signature Signature Verification
Pseudo-random sequences
It plays a crucial role in cryptography by providing sequences of numbers that appear random but
are generated deterministically using an algorithm. Here’s a breakdown of their importance,
characteristics, and applications in cryptography
What Are Pseudo-Random Sequences?
• A pseudo-random sequence is a series of numbers that:
• Appears random: The sequence exhibits statistical properties of randomness.
• Deterministic: It is generated using a deterministic process, typically a mathematical algorithm,
starting from an initial value called a seed.
• The term "pseudo" indicates that these sequences are not truly random because they are
produced by algorithms, but they are sufficiently unpredictable for cryptographic purposes when
designed correctly.
Characteristics of Pseudo-Random Sequences in Cryptography
• Unpredictability: Given part of the sequence, it should be computationally infeasible to predict
the next value without knowing the seed.
• Determinism: The same seed always produces the same sequence, which is useful for
reproducibility in cryptographic protocols.
• Statistical Randomness: The sequence should pass statistical tests for randomness, such as
uniform distribution and lack of patterns.
• Periodicity: While pseudo-random sequences are periodic (since they are generated
Cryptographic Applications
a. Key GenerationPseudo-random number generators (PRNGs) are used to generate cryptographic
keys, such as symmetric keys in AES or private keys in RSA and ECC.
b. Initialization Vectors (IVs)IVs are nonces (numbers used once) required in encryption schemes like
CBC (Cipher Block Chaining). They are often derived from pseudo-random sequences.
c. NoncesNonces prevent replay attacks in protocols. They are generated using pseudo-random
sequences to ensure uniqueness.
d. Salt in HashingSalts used in password hashing schemes are often pseudo-random to prevent
precomputed attacks like rainbow tables.
e. Stream CiphersStream ciphers like RC4 and ChaCha20 use pseudo-random sequences to XOR
plaintext for encryption.
f. Secure CommunicationProtocols like TLS rely on pseudo-random sequences for key exchange and
session key generation.

Types of Generators in Cryptography


• Pseudo-Random Number Generators (PRNGs):Algorithms like Mersenne Twister or Linear
Congruential Generators (LCGs) are fast but not secure for cryptographic purposes.
• Cryptographically Secure Pseudo-Random Number Generators (CSPRNGs):Designed to
meet cryptographic standards of unpredictability.Examples: Fortuna, Yarrow, and algorithms based
on AES or SHA-256.
• True Random Number Generators (TRNGs):Use physical processes like thermal noise for
Key exchange (also key establishment)
It is a method in cryptography by which cryptographic keys are exchanged between two
parties, allowing use of a cryptographic algorithm.

If the sender and receiver wish to exchange encrypted messages, each must be equipped to
encrypt messages to be sent and decrypt messages received. The nature of the equipping
they require depends on the encryption technique they might use. If they use a code, both
will require a copy of the same codebook. If they use a cipher, they will need appropriate
keys. If the cipher is a symmetric key cipher, both will need a copy of the same key. If it is
an asymmetric key cipher with the public/private key property, both will need the other’s
public key.
Key exchange with Symmetric key
Key exchange in symmetric cryptography is the process of sharing a secret key between two
parties so that they can communicate securely. The key is used to encrypt messages for sending
and decrypt messages for receiving.

Here are some things to know about key exchange with symmetric cryptography:
• Key exchange is required : For two parties to communicate securely, they must first
exchange the key. If the key is intercepted by a third party, they can decrypt the messages.
• Key exchange can be difficult : It can be difficult to establish a shared key using only
symmetric encryption algorithms.
• Asymmetric encryption can help :Asymmetric encryption can be used to securely exchange
the symmetric key. For example, web browsers and servers use an SSL/TLS handshake to
generate a shared symmetric key.
• Symmetric encryption is efficient :Symmetric encryption is generally more efficient than
asymmetric encryption, making it a good choice for exchanging large amounts of data.
• Symmetric encryption algorithms: Symmetric encryption algorithms include AES, DES, and
3DES.
Key exchange with Public key cryptography
Public key cryptography uses a two-key system to exchange keys and establish a secure
communication channel:
• Public key: Can be sent openly over a network or shared in public.
• Private key: Kept private by the owner.

The public and private keys are cryptographic inverses of each other, so what one key
encrypts, the other key will decrypt. For example, if Alice wants to send a secret message to
Bob, she can send him her public key and Bob can encrypt the message using that key. Alice
can then decrypt the message with her private key.

Public key cryptography is also known as asymmetric cryptography because it uses two keys
instead of one. It's used in many applications, including secure communication, online
transactions, and access control
Man-in-the-Middle Attack
• It is a cyberattack where the attacker secretly relays and possibly alters the communications
between two parties who believe that they are directly communicating with each other, where in
actuality the attacker has inserted themselves between the two user parties.
• This situation arises because the two persons who are communicating are unable to verify the
status of the person communicating with them, taking the assumption that the interception process
does not cause interference in the network.

Here is how it works:


• User A sends a message to user B
• The attacker (user C) intercepts the communication, and send a new message to user B (the
original recipient of user A message)
• User B sends back an answer to user A
• The attacker intercepts the answer from user B
• The attacker then sends another answer to user A
Interlock protocol
• This man-in-the-middle-attack problem can be overcome by using an interlock protocol. The core algorithm
of this protocol is that this protocol sends two parts of encrypted message
• It is a protocol designed to frustrate eavesdropper attack against two parties that use an anonymous key exchange
protocol to secure their conversation.
• The Interlock Protocol was described as a method to expose a middle-man who might try to compromise two parties that
use anonymous key agreement to secure their conversation.
How it works
1. Anu shares her public key with Bhuvan.
2. Bhuvan reciprocates by providing Anu with his public key.
3. Anu encrypts her message using Bhuvan's public key and sends half of the encrypted message to Bhuvan.
4. Bhuvan encrypts his message with Anu's public key and sends half of the encrypted message to Anu.
5. Anu sends the other half of her encrypted message to Bhuvan.
6. Bhuvan combines the two halves of Anu's message and decrypts it with his private key. He then sends the
other half of his encrypted message to Anu.
7. Anu combines the two halves of Bhuvan's message and decrypts it with her private key.
How It Defeats MITM Attacks

1. Incomplete Information:
• An attacker attempting to intercept and decrypt the messages will not have the necessary keys
to decrypt both halves of a message until it's fully exchanged.

2. Sequential Dependency:
• If an attacker modifies the first half of the message, they cannot create a valid second half
without knowing the private key of the sender.
• Since decryption depends on completing the exchange, the protocol ensures that each party
confirms the authenticity of the communication at each stage.

3. Authentication of Encryption Keys:


• Combined with other authentication mechanisms (like certificates), interlock protocols can
ensure the keys themselves are not spoofed, further securing against MITM.
Key exchange with a digital signature
It is a cryptographic method that combines key exchange techniques with digital signatures to establish a
shared secret key between two parties while ensuring authenticity and integrity.
Steps in Key Exchange with Digital Signature
1. Key Exchange Setup:
• Two parties, typically called Alice and Bob, wish to establish a shared secret key to secure their
communication.
• They use a key exchange algorithm, such as Diffie-Hellman or Elliptic Curve Diffie-Hellman (ECDH).
2. Generation of Key Exchange Parameters:
• Both parties generate key pairs (public key and private key).
• These keys are used in the key exchange algorithm to compute the shared secret.
3. Digital Signature for Authentication:
• Each party signs their public key or key exchange message using their private signing key. This
signature ensures that the public key or message originates from the claimed party.
• The signature can be generated using algorithms like RSA, ECDSA, or EdDSA.
4. Exchange of Messages:
• Alice sends her public key, key exchange parameters, and digital signature to Bob.
• Bob does the same, sending his public key, key exchange parameters, and digital signature to Alice.
5. Verification of Signatures:
• Upon receiving the signed messages, both parties verify the signatures using the sender's public
signing key.
• If the verification succeeds, it confirms the authenticity and integrity of the received message.
6. Derivation of Shared Secret:
• Using the key exchange algorithm (e.g., combining their private key with the other party's public key),
both parties independently compute the same shared secret.
Key and Message Transmission
1. Anu generates a random session key, K, and encrypts the message, M, using K (Ex(M)).Since the
ha breaking into the the one-way fum ), passwords.
2. Anu retrieves Bhuvan's public key from the database.Dictionar
3. Anu encrypts K with Bhuvan's public key (EB(K)).
4. Anu sends both the encrypted message and the encrypted session key to Bhuvan (EK(M Ев(К)).A
file of p
5. For added security against man-in-the-middle attacks, Anu can sign the transmission.In his sp
processes all 1 pproximately
6. Bhuvan decrypts Anu's session key, K, using his private key.
7. Bhuvan decrypts Anu's message using the session key.
Key and Message Broadcast
In this scenario, Anu can send an encrypted message to multiple recipients, for example, Bhuvan,
Chitra, and Dinesh:

1. Anu generates a random session key, K, and encrypts the message, M, using K (Εκ(Μ)).The point
2. Anu retrieves the public keys of Bhuvan, Chitra, and Dinesh from the database.
3. Anu encrypts K with each recipient's public key (Ев(K), EC(K), ED(K)).
4. Anu broadcasts the encrypted message and all the encrypted keys to anyone who wishes to
receive it (EB(K), EC(K), ED(K), Ex(М)).dictionary ever massive pre-co
5. Only Bhuvan, Chitra, and Dinesh can decrypt the session key, K, using their respective private
keys.
6. Only Bhuvan, Chitra, and Dinesh can decrypt Anu's message using the session key.
Authentication
When Anu logs into a host computer , how does the host know who she is? How does the host
know she is not Jay trying to falsify Anu's identity?
Traditionally, passwords solve this problem.
Anu enters her password, and the host confirms that it is correct. Both Anu and the host know
this secret piece of knowledge, and the host requests it from Anu every time she attempts to log
in.

Authentication Using One-way Functions


The host need not know the passwords; the host just has to be able to differentiate valid
passwords from invalid passwords. This is easily achieved with one-way functions. Instead of
storing passwords, the host stores one-way functions of the passwords:
1. Anu sends the host her password.
2. The host performs a one-way function on the password.
3. The host compares the result of the one-way function to the value it previously stored
Dictionary Attack
It is a type of cyber attack in which an attacker uses a pre-compiled database, or a 'dictionary' of
common usernames and passwords, in an attempt to gain unauthorized access to an account or
system.
How Salt Plays a Preventive Role Against Dictionary Attacks
• The 'Role of Salt in Security', especially in relation to dictionary attacks, is quite significant.
• When a salt value is added to a password, it makes dictionary attacks incredibly difficult.
• This is because the salt alters the hash output of the password, meaning that even common
passwords result in unique hashed values, thanks to the added salt.
• However, what makes a salt value uniquely powerful is not simply its addition to a password, but
that it's different for each user. This concept is known as 'unique salt per user’.
• It ensures that even if two users have the same password, their hashed (and salted) passwords will
be different. This difference is because each salt value is randomly generated and unique, making
it virtually impossible for an attacker to anticipate.
Examples of Salt in Action
• Imagine a user database where passwords are stored in their hashed form.
• Now, if an attacker manages to get their hands on that database, they would try to decipher the
hashed password using a dictionary attack.
• Without a salt value, if a user’s password is 'password123' (a common password), the attacker,
using a dictionary attack, can easily find the corresponding hash value.
• They then gain unauthorized access to those accounts. But if each password is salted uniquely,
each 'password123' will have a different hash value, rendering the dictionary attack useless.
SKEY
• SKEY is an authentication program that relies on a one-way function for its security.
• To set up the system, Anu enters a random number, R. The computer computes f(R), f(f(R)),
f(f(f(R))), andso on, about a hundred times. Call these numbers x1, X2, X3,..., X100.

The computer prints out this list of numbers:


1. Anu puts it in her pocket for safekeeping. The computer also stores x101, in the clear, in a login
database next to Anu's name.
2. The first time Anu wants to log in, she types her name and x100. The computer calculates
f(x100) and compares it with X101; if they match, Anu is authenticated.
3. Then, the computer replaces x101 with x100 in the database. Anu crosses x100 off her list.
Every time Anu logs in, she enters the last uncrossed number on her list: xi.

The computer calculates f(xi) and compares it with xi+1a stored in its database. Jay can't obtain any
useful information because each number is only used once, and the function is one-way. Similarly,
the database is not useful to an attacker. Of course, when Anu runs out of numbers on her list, she
has to reinitialize the system
Authentication and Key Exchange
Even with salt, the first protocol has serious security problems. When Anu sends her password to her
host, anyone who has access to her data path can read it. She might be accessing her host through a
convoluted transmission path that passes through four industrial competitors, three foreign
countries, and two forward-thinking universities. Jay can be at any one of those points, listening to
Anu's login sequence. If Jay has access to the processor memory of the host, she can see the
password before the host hashes it.
Public-key cryptography can address this issue. The host maintains a file of every user's public key;
all users keep their private keys. Here is a simple attempt at a protocol. When logging in, the protocol
proceeds as follows:
1. The host sends Anu a random string.
2. Anu encrypts the string with her private key and sends it back to the host, along with her name.
3. The host looks up Anu's public key in its database and decrypts the message using that publickey.
4. If the decrypted string matches what the host sent Anu in the first place, the host allows Anu
access to the system.

No one else has access to Anu's private key, so no one else can impersonate Anu. More importantly,
Anu never sends her private key over the transmission line to the host. Jay, listeningin on the
interaction, cannot obtain any information that would enable her to deduce the private key and
impersonate Anu.
The private key is both long and non-mnemonic and will likely be processed automatically by the
user's hardware or communications software. This necessitates an intelligent terminal that Anu
Mutual Authentication Using the Interlock Protocol
In the context of mutual authentication, Anu and Bhuvan aim to verify each other's identities. They
both possess knowledge of each other's passwords: Anu has PA, and Bhuvan has PB. However, there
is a protocol that is susceptible to attack:
1. Initially, Anu and Bhuvan exchange public keys.
2. Anu encrypts PA with Bhuvan's public key and transmits it to him.
3. Bhuvan encrypts PB with Anu's public key and sends it to her.
4. Anu decrypts the message received in step (2) and confirms its correctness.
5. Bhuvan decrypts the message received in step (3) and validates its accuracy.

This protocol is vulnerable to a man-in-the-middle attack. Mahesh can intercept both public keys,
replace Bhuvan's public key with his own, and send it to Anu. He does the same with publ's public
key for Bhuvan. Mahesh can then manipulate the encryption and decryption steps to gath knowledge
of both PA and PB.
Authentication and key Exchange
Authentication is the process of confirming the identity of communicating entities such as users,
devices, or servers. It ensures that the parties involved are who they claim to be

There are several authentication methods, including:


Passwords: Users provide a secret password that should match the stored credentials on the
server.
Biometrics: This involves using unique biological characteristics like fingerprints, iris scans, or
facial recognition for identity verification
Multi-factor Authentication (MFA): Requires multiple forms of identification, such as a password
combined with a temporary code sent to a mobile device.
Certificates: Digital certificates issued by trusted Certificate Authorities (CAs) to validate the
identity of a server or client in SSL/TLS connections.

Authentication Key Exchange (AKE) is the exchange of session key in a key exchange protocol which
also authenticates the identities of parties involved in key exchange. It is a way for two parties to
securely talk to each other, ensuring they both know who they're talking to and can keep their
conversation private.

Let's imagine Alice and Bob want to have a secret conversation over the internet. They want to be
sure that nobody else can listen in or pretend to be them during their chat. They use an AKE
Wide Mouth Frog Protocol
The Wide Mouth Frog Protocol is a computer network verification protocol typically used on
unsecured networks.
It permits people communicating over a network to verify their identity to each other, it also
helps in preventing replay attacks, or snooping and offers detection of any alteration and the
prevention of any unwanted reading.
However, to avoid active attacks, some form of message authentication or authenticated
encryption must be used.
The protocol can be specified as follows in security protocol notation, where user A is verifying
itself to user B using a server S:
• Where the identities of user A, user B, and the trusted server are A, B, and S respectively.

• Timestamps generated by user A and server S are TS1 and TS2 respectively.

• A Symmetric key KAS that is only known to A and S.

• A generated symmetric key KAB, which will be the session key of the session between user A
and user B.

• A Symmetric key KBS that is only known to B and S.


A → S: A, {T{S1}, B, K{AB}}K{AS}
S → B: {T{S2}, A, K{AB}}K{BS}

To understand the working let’s consider the example of the Wide-Mouthed-Frog protocol:
M1 A → S: {T{S1}.B.K{AB}}SKey(A)
M2 S → B: {T{S2}.A.K{AB}}SKey(B)
Here the server shares two different keys that are SKey(A) and SKey(B) with A and B; the
purpose of the protocol is to establish a session key K{AB} between user A and user B, and to
verify A to B. After that user A creates a session key and directs it to the server along with a
timestamp TS1; the server then sends the key to user B along with a new timestamp TS2.
Timestamps are generally used so that the users can obtain indications that the messages they
have received were created recently. It should be noted that for passing and for this mechanism
to work the different users’ clocks need to be synchronized; each user’s clock is crucial to the
security of the protocol.
Yahalom protocol
It is an authentication and secure key-sharing protocol designed for use on an insecure network
such as the Internet. Yahalom uses a trusted arbitrator to distribute a shared key between two
people. This protocol can be considered as an improved version of Wide Mouth Frog protocol.
Needhan Schroeder Protocol
The Needham–Schroeder protocol is a set of key transport protocols that can be used over
insecure networks:
Kerberos Protocol
Kerberos is a network authentication protocol that uses symmetric key cryptography and a
key distribution center (KDC) to verify user identities.
Four basic approaches to the analysis of
cryptographic protocols

1. Symbolic model analysis


2. Computational model analysis
3. Logic based approaches
4. Automated tools and verification
1. Symbolic Model Analysis
Description:
• This approach treats cryptographic operations (e.g., encryption, hashing) as black-box
abstractions.
• It operates in a simplified model
Key Features:
• Assumes perfect cryptography, where cryptographic primitives cannot be broken.
• Focuses on the logical structure of protocols rather than their computational security.
Strengths:
• Simplifies reasoning about protocols.
• Allows formal methods, such as model checking or theorem proving.
Limitations:
• May overlook real-world attacks (e.g., side-channel attacks or cryptographic weaknesses).
Examples:
• Tools like ProVerif and Tamarin use symbolic models.
2. Computational Model Analysis

Description:
This approach uses precise mathematical definitions and considers the computational hardness of
cryptographic primitives.
Key Features:
• Models adversaries as probabilistic polynomial-time algorithms.
• Measures security based on the probability of adversarial success.
Strengths:
• Closely aligns with real-world cryptographic security.
• Accounts for probabilistic behavior and resource-bounded adversaries.
Limitations:
• Computationally expensive and less automated than symbolic methods.
• Harder to scale for complex protocols.
Examples:
• Formal proofs in the Universal Composability (UC) framework or using tools like EasyCrypt.
3. Logic-Based Approaches
Description:
These methods employ formal logic (e.g., modal logic or temporal logic) to model and analyze the
behavior of cryptographic protocols.
Key Features:
• Specify protocols and their properties using logical formulas.
• Prove or disprove properties like secrecy or authenticity.
Strengths:
• Provides a structured and rigorous framework.
• Suitable for reasoning about trust and belief in protocols.
Limitations:
• Can be complex and prone to errors in formalization.
• May require expert knowledge of logic systems.
Examples:
• BAN Logic (Burrows-Abadi-Needham Logic) for reasoning about authentication protocols.
4. Automated Tools and Verification
Description:
• This approach uses automated tools to verify the correctness and security of cryptographic
protocols.
Key Features:
• Combines symbolic and computational models for automated analysis.
• Employs techniques like model checking, theorem proving, or SAT solving.
Strengths:
• Increases efficiency and reduces human effort.
• Scalable for complex protocols.
Limitations:
• Relies on the correctness of the tools themselves.
• May produce false positives or negatives.
Examples:
• Tools like ProVerif, AVISPA, and Scyther.
Secret Splitting
Description:
A method of dividing a secret into multiple parts (shares) such that each part is individually
meaningless and does not reveal any information about the secret.
Key Features:
Reconstruction Requirement: All parts (or a specific subset) must be combined to reconstruct the
secret.
Security:
A single share (or any insufficient subset) provides no information about the secret.
Use Case:
Often used in scenarios where the secret must be fully protected unless all parties collaborate.
Example:

such that:𝐾=𝐾1⊕𝐾2
Suppose a secret key K is split into two parts, K1 and K2,

Here, K1 and K2 is a random value, and K2 is computed as 𝐾1⊕𝐾2.


Both parts are required to reconstruct the secret.
Secret Sharing
Description:
A generalization of secret splitting, where a secret is divided into multiple shares, but only a subset of
the shares is sufficient to reconstruct the secret. This is commonly referred to as (t, n) threshold secret
sharing, where:
• t is the minimum number of shares required to reconstruct the secret.
• n is the total number of shares distributed.

• Threshold Property: Any 𝑡t or more shares can reconstruct the secret, while fewer than 𝑡t shares
Key Features:

reveal nothing.
• Flexibility: Shares can be distributed to multiple parties, and redundancy is built into the system.
Common Schemes:
• Shamir’s Secret Sharing:
Based on polynomial interpolation.
A secret S is encoded as the constant term of a random polynomial f(x) of degree t−1:

Any 𝑡t points can reconstruct the polynomial using Lagrange interpolation.


Shares are generated as points on the polynomial, i.e.,

Uses geometric principles where the secret is a point in 𝑛-dimensional space, and shares are
• Blakley’s Secret Sharing:

hyperplanes intersecting at the secret point.


Applications:
• Secure multi-party computation.
Comparison

Feature Secret Splitting Secret Sharing


Reconstruction Threshold ttt out of nnn
All parts required
Threshold parts
Less flexible, requires all More flexible with
Flexibility
shares redundancy
Security with Few
No information revealed No information revealed
Shares
Distributed trust, fault
Common Use Cases Simple key splitting
tolerance
Cryptographic protection of databases

Cryptographic protection of databases involves applying cryptographic techniques to secure data


stored in databases. This ensures the confidentiality, integrity, and, in some cases, availability of
sensitive data against unauthorized access or tampering.
Below is an overview of key cryptographic approaches and best practices for database protection:
1. Encryption
2. Tokenization
3. Hashing
4. Access Control Mechanism
5. Database Level Encryption Features
6. Homomorphic Encryption
7. Secure Key Management
8. Database Auditing and Monitoring
9. Secure Communication Protocols
10.Data MAsking
UNIT-2 INTERMEDIATE PROTOCOLS
Time Stamping
Time stamping is a method to prove the existence of a document or piece of data at a specific
point in time. It is commonly used in digital systems to establish the chronology of events or data.
Key Features:
• Digital Time Stamps: A hash of the data is created and linked to a trusted time source, often
by a trusted third party or blockchain.
Applications:
• Proof of authorship
• Ensuring data integrity
• Legal contracts
Example:
A document is hashed, and the hash is sent to a time-stamping service that appends the current
time and signs the result with its private key.
Steps for timestamp a document:
• Document Preparation
• Timestamp Request
• TSA Verification and Timestamping
• Issuance of Time Tamped Token
• Verification
Subliminal Channel
A subliminal channel is a covert communication channel hidden within another legitimate
communication. It's often studied in the context of cryptographic protocols and steganography.
Key Features:
• Hidden Information: A sender embeds secret data into the legitimate output of a
cryptographic protocol, such as a digital signature or encrypted message.
• Threats: Can undermine security if adversaries use it for unauthorized communication.
Equation of Subliminal channel:
1. Embedding Equation
• Cover msg + hidden information = stenographic cover msg
2. Decoding Equation
• stenographic cover msg – cover msg= hidden information
Digital Signature
A digital signature is a cryptographic method used to verify the authenticity and integrity of data.
Key Features:
How It Works:
• A user generates a hash of the data.
• The hash is encrypted with their private key, creating the signature.
The recipient decrypts it using the user’s public key and compares the result with a new hash of
the data.
Properties:
• Authenticity: Confirms the sender's identity.
• Integrity: Ensures data hasn't been tampered with.
• Non-Repudiation: Prevents the sender from denying authorship.
Applications: Secure emails, software verification, blockchain.
Bit Commitment
Bit commitment is a cryptographic protocol where one party (committer) commits to a chosen
value (a bit or a string) while keeping it hidden from the other party, ensuring they cannot change
it later.
Key Features:
Phases:
• Commit Phase: The committer sends a "commitment" to the receiver, which hides the value
but binds them to it.
• Reveal Phase: The committer reveals the value and proves it matches the commitment.
Properties:
• Binding: The committer cannot change the value after committing.
• Hiding: The receiver cannot guess the value until it is revealed.
Applications: Secure voting, zero-knowledge proofs, multiparty computation.
Fair Coin Flip Protocols
A fair coin flip protocol ensures that two or more parties can generate a random binary outcome
(like flipping a coin) without trusting each other or requiring a trusted third party.
Key Features:
Problem: Ensuring fairness so no party can influence or predict the outcome.
Phases:
• Commitment phase
• Reveal Phase
Applications:
• Cryptographic games
• Secure protocols for distributed systems
Mental poker
It refers to cryptographic protocols that allow players to play a fair game of poker over a
distance (e.g., via computer) without a trusted third party, and without any player being able
to cheat or learn others’ cards.
Key Features:
• No trusted dealer required.
• Ensures fairness: no one can manipulate the shuffle or peek at cards.
• Cards are effectively encrypted, shuffled, and dealt using cryptographic primitives.
• Based on techniques like commutative encryption, zero-knowledge proofs, and
oblivious transfer.
Example Use Case:
• Playing card games online where privacy and fairness must be preserved without a central
server.
Key Escrow Cryptography

Definition:
Key escrow is a system in which encryption keys are held in escrow (trusted storage) so
that, under certain conditions (e.g., a legal warrant), a third party can access encrypted
data.
Key Features:
• Usually implemented by governments or organizations for accountability or surveillance.
• Often controversial due to privacy concerns.
• Used in systems like the Clipper Chip (U.S., 1990s) and enterprise key management
systems.
Example Use Case:
• Corporate environments where a company wants to ensure access to employees’
encrypted files after departure.
• Law enforcement access to encrypted communication under a court order.
Secret Elections (Private Voting Protocols)

Goal: Enable verifiable and anonymous voting, where:No one can determine how someone else
voted.Everyone can verify that votes were counted correctly.

Key Techniques:

• Homomorphic encryption: Allows tallying encrypted votes without decrypting them


individually.
• Mix-nets: Shuffle encrypted votes to break link between voter and vote.
• Blind signatures: Let voters get their ballot signed without revealing its content.
• Zero-knowledge proofs: Prove a vote was valid without showing the actual vote.

Real-World Example:
• Helios voting system, Estonia's e-voting.
Secure Multiparty Computation (SMPC or MPC)

Goal:
Multiple parties compute a function over their private inputs without revealing those inputs to
each other.

Classic Example:
"Yao's Millionaires' Problem" – Two people want to know who is richer without revealing their
actual wealth.

Approaches:
• Secret sharing (e.g., Shamir’s secret sharing): Each party holds a piece of the data.
• Garbled circuits: Encrypt the function itself; others evaluate without learning internals.
• Homomorphic encryption: Enables operations on encrypted data.

Use Cases:
Privacy-preserving data analytics.Joint auctions or bidding.Collaborative machine learning (e.g.,
federated learning with privacy).
Anonymous Message Broadcast (Dining Cryptographers Problem)

Goal: Allow a user to send a message to a group anonymously so that:


• No one can tell who sent the message.
• The message itself is still delivered.

Key Protocol:
• Dining Cryptographers Protocol (by David Chaum):
• Each participant shares keys with neighbors.
• XORs reveal if someone paid (sent message), but not who.

Variants:
• DC-nets (Dining Cryptographers Networks)
• Mix-nets and Onion Routing (used in Tor)
• Riposte: A modern anonymous broadcast system.
Digital Cash (Cryptographic e-Cash Notes)

Goal:
Mimic the privacy and untraceability of physical cash in digital form, while preventing double-
spending.

Key Features:
• Anonymity: No one knows who owns or spends a coin.
• Unforgeability: Coins can't be copied or faked.
• Double-spending detection: If someone tries to reuse a coin, they’re caught.

Techniques Used:
• Blind signatures : Bank signs a coin it can’t link to the spender.
• Zero-knowledge proofs: Prove you own a valid coin without revealing it.
• Cryptographic accumulators and Merkle trees in modern versions.
UNIT – 3 KEY LENGTH
KEY LENGTH
 In cryptography, key length is the number of bits in a
key used for encryption. Key length is measured in bits
and is a key factor in determining the security of
encryption.
 Key length and security
 Longer keys are more secure than shorter keys.
 Different ciphers may require different key lengths to
achieve the same level of security.
 The key length defines the upper-bound on an
algorithm's security.
 The security of all algorithms can be violated by brute-
force attacks.
Key Size and Encryption System
There are two types of encryption systems:
Symmetric Systems: These are the algorithms for cryptography
that use the same cryptographic keys for both encryption and
decryption of ciphertext.
Asymmetric Systems: These are the algorithms that use pair of
related keys. Each key pair consists of a public key and a
corresponding private key.

The security in a symmetric cryptosystem depends on two things:


Strength of the algorithm.
Length of the key.
There are two main types of attacks on a cipher, brute force, and
cryptanalysis. Let’s analyze the impact of the key size on a brute-
force attack. A brute force attack is also known as a plain text attack.
Key Size Impact in Brute Force Attack
 Assuming that the algorithm is just perfect by perfect
we mean that there is no way to break the cryptosystem
other than performing the brute-force attack.
 Calculating the complexity of a brute force attack is
easy, if the length of the key is 8 bits then there will be
256 possible keys.
 This implies it will take only 256 attempts to crack the
correct key.
 Similarly, if the key is 56 bits long then it would take
2^256 that is it will take 2285 years in finding the
correct key.
Time and cost Estimates for brute force attack:
 A brute force attack requires cipher text and plain text in small amounts. If you
think that the brute force attack is the most efficient possible attack against an
algorithm, then a big assumption would be, How long should a key be?
 There are two parameters that will determine the speed of a brute force attack:
 The number of keys tested.
 Test speed (time spent testing each key).
 Most of the symmetric keys accept fixed-length bit patterns as the key.
Generally, the DES(Data encryption standard) has a 56-bit key, which implies
256 possible keys. The speed at which a public key is tested is also a factor, but
less important, because we are focusing on the length of the keys which will be
more difficult to crack, small differences due to speed are irrelevant.
 A brute force attack is tailor-made for parallel processors where each processor
tests a subset of the keyspace.
 These parallel processors do not have to communicate with each other thus
only message for which they communicate is “success”.
 There are no shared memory requirements therefore it is easy to design a
multi-processor system having millions of processors each working
independently of others.
Key Size Impact in Virus Attack
 The greatest difficulty in getting millions of computers to work on a
brute force attack is to convince these millions of owners of
computers to participate. One can ask the owners but then the
owner can also say no, another way is to break into their machines
but that’s time-consuming. So, the easiest way is to create a
computer virus for cracking a computer program more efficiently.
 The idea was to create a virus that won’t format or harm the user
files but rather work on a brute force attack whenever the
computer was idle and not performing any computation.
 Eventually, one machine will find the correct key at that point there
are two ways proceedings.
 First, the virus could spawn a different virus which will delete any
copies of the cracking virus it finds but would contain the
information about the correct key.
 This virus would simply propagate through the computer world until
it lands on the computer of the person who wrote the original virus.
Public key length
Public-key encryption (also called asymmetric encryption) involves a pair of keys—
a public key and a private key—associated with an entity that needs to authenticate its
identity electronically or to sign or encrypt data.
 Each public key is published, and the corresponding private key is kept secret. The
following figure shows a simplified view of the way public-key encryption works.
RSA (Rivest–Shamir–Adleman):
 RSA is a widely used public-key cryptosystem based on the
difficulty of factoring large numbers.
 For equivalent security to 128-bit symmetric encryption, RSA
typically requires 2048-bit keys, and 3072-bit keys are
considered more secure.
 RSA is used for secure data transmission and encryption, and is
also used for digital signatures.
 DSA (Digital Signature Algorithm):
 DSA is a digital signature algorithm used for verifying the
authenticity of a message, generating and verifying signatures.
 DSA is based on the difficulty of the discrete logarithm problem.
 DSA and RSA are similar in their cryptographic strength, but
DSA is faster for signing, while RSA is faster for verifying.
ECC (Elliptic Curve Cryptography):
 ECC is a public-key cryptography method based on the
algebraic structure of elliptic curves over finite fields.
 ECC achieves the same level of security as RSA and DSA with
smaller key sizes.
 For example, a 256-bit ECC key is equivalent to a 3072-bit RSA
key.
 ECC is more efficient in terms of key size and processing power,
making it suitable for resource-constrained devices.
 ECDSA (Elliptic Curve Digital Signature Algorithm) is the digital
signature algorithm based on ECC.
UNIT -4
Information Theory
Information theory is a mathematical framework developed by Claude Shannon for
quantifying information, entropy, and communication efficiency.
Key Concepts:
• Entropy (H): Measures the uncertainty or randomness of information.
Higher entropy = more unpredictable data.
• Redundancy: Extra bits added to detect or correct errors in transmission.
• Channel Capacity: Maximum data rate at which information can be reliably transmitted
over a communication channel.
• Compression: Removing redundancy (e.g., Huffman coding, Lempel-Ziv)
• Error Detection and Correction: Techniques like parity bits, CRC, and Hamming codes.
Applications in Cryptography:
• Evaluating how much information is leaked through a cipher.
• Designing secure communication protocols that minimize information exposure.
Number Theory

Number theory is the study of integers and their properties, especially primes, divisibility, and
modular operations.

Important Concepts:
• Primes: Cannot be divided by other numbers (e.g., 2, 3, 5, 7).
• Modular Arithmetic: Used in RSA and Diffie-Hellman.
Example: 7 mod 3 = 1GCD, LCM: Useful in computing multiplicative inverses.
• Euler’s Theorem:
If a and n are coprime: a^φ(n) ≡ 1 mod n
• Fermat’s Little Theorem:
If p is prime and a is not divisible by p, then:a^(p−1) ≡ 1 mod p

Application:
• Encryption, digital signatures, hashing.
Computational Complexity Theory

This theory studies how difficult problems are to solve in terms of time and space.
Key Complexity Classes:
• P (Polynomial Time): Solvable quickly (e.g., sorting).
• NP (Nondeterministic Polynomial Time): Verifiable quickly (e.g., Sudoku).
• NP-Complete: Hardest in NP. If one can be solved quickly, all can.
• NP-Hard: Even harder than NP-complete in some cases.
Importance in Cryptography:
• Cryptographic security depends on hard problems, like:
• Integer factorization (RSA)
• Discrete logarithm (Diffie-Hellman, ECC)
• If these problems are solved efficiently, many encryption systems break.
Prime Number Generation (DBS)
In cryptography, large prime numbers are required (e.g., in RSA).
Methods of Prime Generation:
• Random Selection + Primality Test
• Generate a random number and test for primality using:
• Fermat Test (simple but not always accurate)
• Miller-Rabin Test (fast and probabilistic)
• AKS Test (deterministic, slow)
• DBS (Deterministic Binary Search):
• A structured method to search for primes deterministically within a range.
• Useful in provable prime generation.
• Can guarantee a prime exists in an interval using number-theoretic bounds.
Security Need: Cryptographic systems fail if generated primes are small, predictable, or
reused.
Security of DES (Data Encryption Standard)
DES is a symmetric block cipher developed by IBM in the 1970s.
DES Features:
• 64-bit block size.
• 56-bit effective key (outdated).
• Uses 16 rounds of Feistel structure:
• Substitution (via S-boxes)
• Permutation (P-boxes)
• Key mixing
Security Concerns:
• Brute-force vulnerability: 2⁵⁶ keys is searchable with modern computing.
• Linear and Differential Cryptanalysis: Exploit predictable patterns.
• Weak keys: Certain keys produce insecure or repeating encryption.
Improvement:
• 3DES (Triple DES): Encrypt-decrypt-encrypt using multiple keys.
• Increases effective key length (112 or 168 bits)
• Much slower than DES, but more secure.
Stream Ciphers using LFSRs (Linear Feedback Shift Registers)
Stream Cipher:
• Encrypts bit by bit or byte by byte, instead of in blocks.
• Uses a keystream that is XORed with plaintext.
LFSR (Linear Feedback Shift Register):
• A register of bits that shifts with every clock cycle.
• New bit = XOR of specific bits (taps).
• Produces a pseudo-random bit sequence.
Example Use:
• A5/1 stream cipher used in GSM mobile communications.
Advantages:
• Simple hardware implementation.
• Fast and lightweight.
Security Weakness:
• Predictable: If the structure or a portion of output is known, attackers can reconstruct the
internal state.
• Linear: Easy to break with known plaintext attacks.
• Solution: Use non-linear feedback or multiple LFSRs to harden the cipher.
UNIT 5
One-Way Hash Functions

A hash function takes an input (message) and produces a fixed-size output called a hash
or digest.
Key Properties of a One-Way Hash Function:
1.Deterministic: Same input → same output every time.
2.Fast Computation: Easy to compute the hash for any input.
3.Pre-image Resistance: Hard to find input from its hash (one-way).
4.Second Pre-image Resistance: Hard to find another input with the same hash.
5.Collision Resistance: Hard to find two different inputs with the same hash.
Applications:
• Password storage (e.g., hash passwords instead of storing them).
• Data integrity (e.g., verify file hasn't been tampered with).
• Digital signatures (sign the hash of a message, not the message itself).
• Blockchain (e.g., Bitcoin uses hash chaining)
SHA: Secure Hash Algorithms

SHA is a family of hash functions developed by NIST (National Institute of Standards and
Technology).
Common SHA Variants:
• SHA-1:
• Output: 160 bits.
• No longer secure (collision vulnerabilities).
• SHA-2 (e.g., SHA-256, SHA-512):
• SHA-256: Output = 256 bits (most widely used today).
• Secure and widely supported.
• SHA-3:
• Based on Keccak algorithm.
• Different internal design (sponge construction).
• Used where a higher level of post-quantum resistance is desired.
Public Key Algorithms (Asymmetric Encryption)

These algorithms use two keys:


• Public Key: Shared with anyone.
• Private Key: Kept secret.
How it works:
• Encryption: Public key encrypts, private key decrypts.
• Digital Signatures: Private key signs, public key verifies.
Common Public Key Algorithms:
1.RSA (Rivest-Shamir-Adleman):
1. Based on the difficulty of factoring large numbers.
2. Used for encryption, digital signatures, and key exchange.
2.Elliptic Curve Cryptography (ECC):
1. Based on elliptic curves over finite fields.
2. Stronger security with shorter keys than RSA.
3.ElGamal:
1. Based on the discrete logarithm problem.
2. Used in digital signatures (e.g., DSA).
Strength: Asymmetric cryptography enables secure communication without sharing a secret
key beforehand.
Diffie-Hellman
Diffie-Hellman is a public-key algorithm used only to exchange keys, not to encrypt actual data.

Goal:
To allow two parties to agree on a shared secret key over an insecure channel, without anyone else being
able to figure it out.

How It Works:
1.Choose a large prime number p and a base g (both public).
2.Alice chooses secret a and sends A = g^a mod p to Bob.
3.Bob chooses secret b and sends B = g^b mod p to Alice.
4.Alice computes shared key: K = B^a mod p
5.Bob computes shared key: K = A^b mod p

Since: K = g^(ab) mod p = B^a mod p = A^b mod p


They both now have the same secret key.

Security:
Based on the Discrete Logarithm Problem: Given g, p, and g^a mod p, it is hard to find a.

Example (Small Numbers):


Public: p = 23, g = 5 Alice chooses a = 6 → A = 5^6 mod 23 = 8 Bob chooses b = 15 → B = 5^15 mod 23 =
2 Shared key: Alice: 2^6 mod 23 = 18 Bob: 8^15 mod 23 = 18
Now both share the key 18, which can be used for symmetric encryption like AES.
RSA Algorithm (Rivest–Shamir–Adleman)

RSA is a widely used public-key encryption algorithm, based on the difficulty of factoring large numbers.
Key Concepts:
•Asymmetric encryption (public and private keys).
•Security relies on the difficulty of factoring large semiprimes.

How RSA Works:


1.Key Generation:
•Choose two large primes: p and q
•Compute n = p × q
•Compute φ(n) = (p−1)(q−1)
•Choose public exponent e (commonly 65537)
•Compute private exponent d such that:
d × e ≡ 1 mod φ(n)
2.Encryption:
•Ciphertext C = M^e mod n
(M is the message as an integer)
3.Decryption:
•Message M = C^d mod n

Applications:
•Digital signatures
•Secure web browsing (HTTPS)
•Key exchange
Knapsack Algorithm (Merkle–Hellman Cryptosystem)

This is an asymmetric cryptographic algorithm based on the subset sum problem, a known NP-complete problem.
Basic Idea:
•Encrypt a message by treating it as a binary number and mapping it to a sum of selected weights (the knapsack).
•Decryption requires solving the subset sum with a known transformation.

How it Works:
1.Choose a superincreasing sequence W = [w1, w2, ..., wn]
2.Select modulus M > sum(W) and a multiplier R coprime with M
3.Generate public key B = [R × wi mod M for wi in W]

Encryption:
•Convert message to binary vector b = [b1, b2, ..., bn]
•Ciphertext = sum(bi × Bi)

Decryption:
•Multiply ciphertext by modular inverse of R mod M
•Solve the superincreasing knapsack problem to retrieve the bits

Status:
•Historically important but broken by more advanced attacks. Not used in modern cryptography.
DSA (Digital Signature Algorithm)

DSA is a standard for digital signatures, specified by NIST.


Key Purpose:
•Authenticate a message sender and ensure message integrity.

How It Works:
1.Key Generation:
•Choose large prime p, q (q divides p−1), and generator g
•Private key x, Public key y = g^x mod p
2.Signature Generation (for message m):
•Generate random k
•Compute r = (g^k mod p) mod q
•Compute s = (k^−1 * (H(m) + x*r)) mod q
•Signature = (r, s)
3.Signature Verification:
•Compute w = s^−1 mod q
•Compute u1 = H(m)*w mod q, u2 = r*w mod q
•Compute v = ((g^u1 * y^u2) mod p) mod q
•Signature is valid if v == r

Notes:
•DSA is not for encryption, only for signing.
•Secure if used with proper random k; otherwise, it can leak the private key.
ISDN (Integrated Services Digital Network)

ISDN is a set of standards for digital transmission of voice and data over ordinary
telephone copper wires.
Features:
• Supports both voice and data simultaneously.
• Provides higher quality and speed than analog systems.
Components:
• BRI (Basic Rate Interface): 2B+D channels (2 data + 1 control).
• PRI (Primary Rate Interface): 23B+D or 30B+D (varies by region).
Applications:
• Video conferencing
• Telemedicine
• Early internet access before broadband
Current Use:
• Largely obsolete, replaced by DSL, fiber, and VoIP systems.
MD5 (Message Digest Algorithm 5)

MD5 is a widely used hash function, producing a 128-bit digest.


Key Features:
•Fast and simple
•Used for checksums and data integrity

Algorithm:
1.Message is padded to a multiple of 512 bits
2.Initial buffer: 4 words (A, B, C, D)
3.64 operations organized into 4 rounds
4.Output: 128-bit hash (32 hexadecimal characters)

Example:
plaintext
Input: "hello" MD5: 5d41402abc4b2a76b9719d911017c592
Security:
•No longer secure — vulnerable to collision attacks.
•Should not be used for cryptographic purposes (e.g., password hashing).
•Use SHA-2 or SHA-3 instead.

You might also like