Is-Unit 2- Cryptography- Euclidean Algorithm - Extended Euclidean Algorithm
Is-Unit 2- Cryptography- Euclidean Algorithm - Extended Euclidean Algorithm
Examples:
Input: a = 30, b = 20
Output: gcd = 10, x = 1, y = -1
(Note that 30*1 + 20*(-1) = 10)
The extended Euclidean algorithm updates the results of gcd(a, b) using the results calculated by
the recursive call gcd(b%a, a). Let values of x and y calculated by the recursive call be x1 and
y1. x and y are updated using the below expressions.
ax + by = gcd(a, b)
gcd(a, b) = gcd(b%a, a)
gcd(b%a, a) = (b%a)x1 + ay1
ax + by = (b%a)x1 + ay1
ax + by = (b – [b/a] * a)x1 + ay1
ax + by = a(y1 – [b/a] * x1) + bx1
1
⌊b/a⌋* x1
y = x1
Block Cipher
Key Features of Block Ciphers
● Fixed Block Size: The Data is encrypted in a fixed-size block.
● Complex Operations: In block ciphers, substitution combined with permutation
forms the operation to achieve encryption.
● Modes of Operation: Block ciphers employ several modes such as ECB (Electronic
Codebook) and CBC (Cipher Block Chaining) for enhanced security.
Examples: AES (Advanced Encryption Standard), DES (Data Encryption Standard) and
Blowfish.
2
ciphers are made for the scenarios where data needs to be encrypted in the continuous stream
making them suitable for the real-time applications.
It can be categorized into the synchronous, self-synchronizing and one-time pad types. The
Synchronous encryption requires independently generated keystream from both the plaintext and
the ciphertext. They have to be in the same state, with the same key, in order to decode the data
properly.
3
Difference Between Block Cipher and Stream Cipher
Block Cipher Stream Cipher
Block Cipher Converts the plain text into Stream Cipher Converts the plain text
cipher text by taking plain text’s block at a into cipher text by taking 1 bit plain
time. text at a time.
The complexity of block cipher is simple. While stream cipher is more complex.
Block cipher uses confusion as well as While stream cipher uses only
diffusion. confusion.
4
Suitable for applications that require Suitable for applications that require
strong encryption, such as file storage and strong encryption, such as file storage
internet communications. and internet communications.
More secure than stream ciphers when the Less secure than block ciphers when
same key is used multiple times. the same key is used multiple times.
In cryptography, confusion and diffusion are two properties of the operation of a secure cipher.
Both Confusion and Diffusion are used to stop the deduction of the secret writing key, these
properties, when present, work to thwart the application of statistics and other methods of
cryptanalysis.
Confusion is employed for making uninformed cipher text whereas diffusion is employed for
increasing the redundancy of the plain text over the foremost part of the cipher text to make it
obscure. The block cipher solely depends on diffusion, where else, confusion is employed by
both stream and block cipher.
What is Confusion?
In general, the idea of confusion is to obscure the relationship between the key and the plaintext
on one hand, and the ciphertext on the other. This is usually done by intricate methods of
substitution, by replacing one piece of data with another in a disorderly disordered way. The use
of confusion makes it possible to design the key in a way that even if the attacker has part of the
key, it will not be possible to deduce the other part of the key.
Example: The introduction of confusion is done through a substitution cipher whereby each
letter of the plaintext is replaced by a different letter in accordance with a relatively complicated
set of rules.
Confusion = Substitution
a --> b
Example : Caesar Cipher
What is Diffusion?
While in diffusion, it is a cryptographic technique that would ensure that the effect of one or one
plaintext digit would be evenly spread out to a number of ciphertext digits, thereby minimizing
5
on the redundancy on the plaintext. The aim here is to spread the statistical structure of the
plaintext over the entire ciphertext so as to mask patterns of data. It is usually done by use of
permutation as well as; transposition.
Example:In a block cipher, diffusion is responsible for the occurrence in which change in one bit
of the plaintext has an influence on many bits of the ciphertext so as to make it difficult for
attackers to identify any patterns.
Confusion Diffusion
The relation between the cipher text The relation between the cipher text and
and the key is masked by confusion. the plain text is masked by diffusion.
6
❖Block Cipher Modes of Operation:
Block Cipher Modes of Operation define how to securely encrypt and decrypt large amounts of
data using a block cipher. A block cipher is an encryption algorithm that processes data in
fixed-size blocks (e.g., 128 bits) rather than one bit at a time. However, to encrypt data larger
than a single block, different modes of operation are used to ensure both security and efficiency.
Here are a few common modes. Here are a few common modes:
● Electronic Code Book (ECB):
The electronic codebook is the easiest block cipher mode of functioning. It is easier because of
the direct encryption of each block of input plaintext and output is in the form of blocks of
encrypted ciphertext. Generally, if a message is larger than b bits in size, it can be broken down
into a bunch of blocks and the procedure is repeated.
The procedure of ECB is illustrated below:
7
Cipher Block Chaining
Advantages of CBC
● CBC works well for input greater than b bits.
● CBC is a good authentication mechanism.
● Better resistive nature towards cryptanalysis than ECB.
● More secure than ECB as it hides patterns.
Disadvantages of CBC
● Requires the previous ciphertext block for encryption and decryption, making parallel
processing difficult.
8
Cipher Feedback Mode
Advantages of CFB
● Since, there is some data loss due to the use of shift register, thus it is difficult for
applying cryptanalysis.
● Can handle data streams of any size.
Disadvantages of using CFB
● The drawbacks of CFB are the same as those of CBC mode. Both block losses and
concurrent encryption of several blocks are not supported by the encryption.
Decryption, however, is parallelizable and loss-tolerant.
● Slightly more complex and can propagate errors.
9
Output Feedback Mode
Advantages of OFB
● In the case of CFB, a single bit error in a block is propagated to all subsequent blocks.
This problem is solved by OFB as it is free from bit errors in the plaintext block. Thus
errors in transmission don’t propagate.
Disadvantages of OFB
● The drawback of OFB is that, because to its operational modes, it is more susceptible
to a message stream modification attack than CFB.
● If the keystream is reused, security is compromised.
10
The data to be sent is
encrypted by sender A using the public key of the intended receiver
○ 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.
○ A decrypts the received ciphertext using its private key, which is known only to him.
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.
11
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
Let's take some example of RSA encryption algorithm:
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=pxq
n = 7 x 11
n = 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)
φ (n) = 6 x 10
φ (n) = 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
C = 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)
12
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
m=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
n = 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
φ (n) = 192
g.c.d (35, 192) = 1
Step 3: 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
d = 11
The private key is <d, n> = (11, 221)
Hence, private key i.e. d = 11
Example 3:
13
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=pxq
n = 3 x 13
n = 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=pxq
n = 3 x 11
n = 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)
φ (n) = (3 - 1) x (11 - 1)
φ (n) = 2 x 10
φ (n) = 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 x 7 = 1 mod 20
e = (1 + k. φ (n))/ d [let k =0, 1, 2, 3………………]
14
Put k = 0
e = (1 + 0 x 20) / 7
e = 1/7
Put k = 1
e = (1 + 1 x 20) / 7
e = 21/7
e=3
The public key is <e, n> = (3, 33)
Hence, public key i.e. e = 3
Thus, the discarding of every 8th bit of the key produces a 56-bit key from the original 64-bit
key.
DES is based on the two fundamental attributes of cryptography: substitution (also called
confusion) and transposition (also called diffusion). DES consists of 16 steps, each of which is
called a round. Each round performs the steps of substitution and transposition. Let us now
discuss the broad-level steps in DES.
● In the first step, the 64-bit plain text block is handed over to an initial Permutation
(IP) function.
● The initial permutation is performed on plain text.
● Next, the initial permutation (IP) produces two halves of the permuted block; saying
Left Plain Text (LPT) and Right Plain Text (RPT).
● Now each LPT and RPT go through 16 rounds of the encryption process.
● In the end, LPT and RPT are rejoined and a Final Permutation (FP) is performed on
the combined block
● The result of this process produces 64-bit ciphertext.
15
Initial Permutation (IP)
As we have noted, the initial permutation (IP) happens only once and it happens before the first
round. It suggests how the transposition in IP should proceed, as shown in the figure. For
example, it says that the IP replaces the first bit of the original plain text block with the 58th bit
of the original plain text, the second bit with the 50th bit of the original plain text block, and so
on.
This is nothing but jugglery of bit positions of the original plain text block. the same rule applies
to all the other bit positions shown in the figure.
As we have noted after IP is done, the resulting 64-bit permuted text block is divided into two
half blocks. Each half-block consists of 32 bits, and each of the 16 rounds, in turn, consists of the
broad-level steps outlined in the figure.
16
Step 1: Key transformation
We have noted initial 64-bit key is transformed into a 56-bit key by discarding every 8th bit of
the initial key. Thus, for each a 56-bit key is available. From this 56-bit key, a different 48-bit
Sub Key is generated during each round using a process called key transformation. For this, the
56-bit key is divided into two halves, each of 28 bits. These halves are circularly shifted left by
one or two positions, depending on the round.
For example: if the round numbers 1, 2, 9, or 16 the shift is done by only one position for other
rounds, the circular shift is done by two positions. The number of key bits shifted per round is
shown in the figure.
After an appropriate shift, 48 of the 56 bits are selected. From the 48 we might obtain 64 or 56
bits based on requirement which helps us to recognize that this model is very versatile and can
handle any range of requirements needed or provided. for selecting 48 of the 56 bits the table is
shown in the figure given below. For instance, after the shift, bit number 14 moves to the first
17
position, bit number 17 moves to the second position, and so on. If we observe the table , we will
realize that it contains only 48-bit positions. Bit number 18 is discarded (we will not find it in the
table), like 7 others, to reduce a 56-bit key to a 48-bit key. Since the key transformation process
involves permutation as well as a selection of a 48-bit subset of the original 56-bit key it is called
Compression Permutation.
Because of this compression permutation technique, a different subset of key bits is used in each
round. That makes DES not easy to crack.
Step 2: Expansion Permutation
Recall that after the initial permutation, we had two 32-bit plain text areas called Left Plain
Text(LPT) and Right Plain Text(RPT). During the expansion permutation, the RPT is expanded
from 32 bits to 48 bits. Bits are permuted as well hence called expansion permutation. This
happens as the 32-bit RPT is divided into 8 blocks, with each block consisting of 4 bits. Then,
each 4-bit block of the previous step is then expanded to a corresponding 6-bit block, i.e., per
4-bit block, 2 more bits are added.
This process results in expansion as well as a permutation of the input bit while creating output.
The key transformation process compresses the 56-bit key to 48 bits. Then the expansion
permutation process expands the 32-bit RPT to 48-bits. Now the 48-bit key is XOR with 48-bit
RPT and the resulting output is given to the next step, which is the S-Box substitution.
18
—--------------------------------------------------------------------------------------------------------
Data Encryption Standard (DES)
The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National
Institute of Standards and Technology (NIST).
DES is an implementation of a Feistel Cipher. It uses 16 round Feistel structure. The block size is
64-bit. Though, key length is 64-bit, DES has an effective key length of 56 bits, since 8 of the 64
bits of the key are not used by the encryption algorithm (function as check bits only). General
Structure of DES is depicted in the following illustration −
Since DES is based on the Feistel Cipher, all that is required to specify DES is −
Round function
Key schedule
Any additional processing − Initial and final permutation
Initial and Final Permutation
The initial and final permutations are straight Permutation boxes (P-boxes) that are inverses of
each other. They have no cryptography significance in DES. The initial and final permutations
are shown as follows −
19
Round Function
The heart of this cipher is the DES function, f. The DES function applies a 48-bit key to the
rightmost 32 bits to produce a 32-bit output.
20
Expansion Permutation Box − Since right input is 32-bit and round key is a 48-bit, we
first need to expand right input to 48 bits. Permutation logic is graphically depicted in the
following illustration −
21
XOR (Whitener). − After the expansion permutation, DES does XOR operation on the
expanded right section and the round key. The round key is used only in this operation.
Substitution Boxes. − The S-boxes carry out the real mixing (confusion). DES uses 8
S-boxes, each with a 6-bit input and a 4-bit output. Refer the following illustration −
22
There are a total of eight S-box tables. The output of all eight s-boxes is then combined in
to 32 bit section.
Straight Permutation − The 32 bit output of S-boxes is then subjected to the straight
permutation with rule shown in the following illustration:
Explore our latest online courses and learn new skills at your own pace. Enroll and become a
certified expert to boost your career.
Key Generation
The round-key generator creates sixteen 48-bit keys out of a 56-bit cipher key. The process of
key generation is depicted in the following illustration −
23
The logic for Parity drop, shifting, and Compression P-box is given in the DES description.
DES Analysis
The DES satisfies both the desired properties of block cipher. These two properties make cipher
very strong.
Avalanche effect − A small change in plaintext results in the very great change in the
ciphertext.
Completeness − Each bit of ciphertext depends on many bits of plaintext.
During the last few years, cryptanalysis have found some weaknesses in DES when key selected
are weak keys. These keys shall be avoided.
DES has proved to be a very well designed block cipher. There have been no significant
cryptanalytic attacks on DES other than exhaustive key search.
24
❖Authentication:
Authentication is the process of identifying users that request access to a system, network, server,
app, website, or device. The primary goal of authentication is to ensure that a user is who they
claim to be. User A, for example, has access to only relevant information and is unable to see
User B’s personal information. Unauthorized users are prevented from accessing sensitive data
with user authentication. Authentication improves security by allowing any Organizational
admin to manage an individual user’s identity and access. The basic authentication used for
identity and access control verification is username and password, with different types of
authentication techniques that we shall cover moving forward.
25
form of a one-time code that they will receive through phone or email in addition to their
Username and Password.
You may quickly configure several Multi-Factor Authentication (MFA) methods to give an extra
layer of security to your resources. OTP/TOTP via SMS, OTP/TOTP over Email, Push
notification, Hardware Token, and Mobile Authenticator are all examples of MFA methods
(Google, Microsoft, Authy, etc). You can choose any of the MFA techniques and implement
them for organizational security based on your needs and requirements. After traditional
password-based login, Multi-Factor Authentication is the most trusted authentication
mechanism. For improved security, password-based traditional authentication and Multi-Factor
Authentication methods are usually used simultaneously.
3. Biometric Authentication:
Individual physical attributes such as fingerprints, palms, retinas, voice, face, and voice
recognition are used in biometric authentication. Biometric authentication works in the following
way: first, the physical characteristics of individuals are saved in a database. Individuals’
physical features are checked against the data contained in the database whenever a user wants to
access any device or physically enter any premises (Organization, School, Colleges, Workplace).
Biometric authentication technology is mostly employed by private organizations, airports, and
border crossing points where security is a top priority. Because of its capacity to create a high
level of security and a user-friendly frictionless flow, biometrics is one of the most often used
security technologies. Among the most common biometric authentication methods are:
1. Fingerprint: To enable access, fingerprint authentication matches the unique pattern of an
individual’s print. In some advanced Fingerprint authentication systems, the vascular structure of
the finger is also sensed. Because it is one of the most user-friendly and accurate biometric
systems, fingerprint authentication is currently the most common biometric technology for
ordinary customers. Biometrics’ popularity can be due to the fact that you use your mobile
phones with fingerprints on a regular basis, as well as companies or institutions that use
Fingerprint authentication.
2. Retina & Iris: Scanners shine a strong light into the eye and look for distinctive patterns in
the colorful ring around the pupil of the eye in this biometric. After that, the scanned pattern is
compared to data recorded in a database. When a person wears spectacles or contact lenses,
eye-based authentication can be inaccurate.
3. Facial: In facial authentication, multiple aspects of an individual’s face are scanned while they
try to get access to a certain resource. When comparing faces from different angles or persons
that look similar, such as family members, face recognition results can be inconsistent.
4. Voice Recognition: Your voice tone is stored with a standardized secret code in the same way
that the above-mentioned approach does. A check occurs because you must speak off each time
you want access.
4. Certificate-based authentication:
Certificate-based authentication identifies people, servers, workstations, and devices by using an
electronic digital identity. In our daily lives, a digital certificate functions similarly to a driver’s
license or a passport. A certificate is made up of a user’s digital identity, which contains a public
key and a certification authority’s digital signature. This certificate verifies that the public key
and the person who issued the certificate are both the same person. When a user attempts to log
in to a server, they must first present their digital certificate. The server checks the digital
26
certificate’s identity and credibility by confirming that the user has a correctly associated private
key with the certificate using cryptography.
5. Token-Based Authentication:
Token-Based Authentication allows users to enter their credentials only once and obtain a
one-of-a-kind encrypted string exchange in return. After that, you won’t have to input your
credentials every time you want to log in or acquire access. The digital token ensures that you
have already been granted access. Most use cases, such as Restful APIs that are accessed by
many frameworks and clients, require token-based authentication.
27
Limitations of Kerberos
● Each network service must be modified individually for use with Kerberos
● It doesn’t work well in a timeshare environment
● Secured Kerberos Server
● Requires an always-on Kerberos server
● Stores all passwords are encrypted with a single key
● Assumes workstations are secure
● May result in cascading loss of trust.
● Scalability
Here are some examples of Kerberos authentication:
● Joining a meeting: A user can click on a link to join a meeting and be automatically
authenticated.
● Accessing a database: A user can access sensitive information in a database without
entering separate credentials.
● Authenticating to a mail server: A user can authenticate to a mail server to prove their
identity.
● Connecting to a MySQL server: A user can connect to a MySQL server using a
Kerberos account.
28
Kerberos authentication protects user credentials from hackers by keeping passwords away
from insecure networks.
How Kerberos authentication works
● The client requests authentication from the KDC.
● The KDC sends a TGT and a session key if the client exists in the database.
● The client asks for a service ticket along with the TGT.
● The KDC sends the ticket encrypted with the session key.
● The client uses the service ticket to request access from the application server.
● The application server authenticates the client and grants access to the service.
Applications of Kerberos
● User Authentication: User Authentication is one of the main applications of
Kerberos. Users only have to input their username and password once with Kerberos
to gain access to the network. The Kerberos server subsequently receives the
encrypted authentication data and issues a ticket granting ticket (TGT).
● Single Sign-On (SSO): Kerberos offers a Single Sign-On (SSO) solution that enables
users to log in once to access a variety of network resources. A user can access any
network resource they have been authorized to use after being authenticated by the
Kerberos server without having to provide their credentials again.
● Mutual Authentication: Before any data is transferred, Kerberos uses a mutual
authentication technique to make sure that both the client and server are
authenticated. Using a shared secret key that is securely kept on both the client and
server, this is accomplished. A client asks the Kerberos server for a service ticket
whenever it tries to access a network resource. The client must use its shared secret
key to decrypt the challenge that the Kerberos server sends via encryption. If the
decryption is successful, the client responds to the server with evidence of its identity.
● Authorization: Kerberos also offers a system for authorization in addition to
authentication. After being authenticated, a user can submit service tickets for certain
network resources. Users can access just the resources they have been given
permission to use thanks to information about their privileges and permissions
contained in the service tickets.
● Network Security: Kerberos offers a central authentication server that can regulate
user credentials and access restrictions, which helps to ensure network security. In
order to prevent unwanted access to sensitive data and resources, this server may
authenticate users before granting them access to network resources.
How Kerberos Version 5 authentication works:
1. Client Authentication Request: The client (user) sends a request to the Authentication
Server (AS), typically with a user ID and possibly a password.
2. Ticket Granting Ticket (TGT): If the client is authenticated successfully, the AS issues
a TGT (Ticket Granting Ticket), which is used to request access to services.
3. Requesting Service Access: The client uses the TGT to request a service ticket from the
Ticket Granting Server (TGS) for a specific service.
29
4. Access Service: The client presents the service ticket to the target service, which then
verifies the ticket using its own secret key and grants access if the authentication is valid.
5. Session Key: Both the client and service communicate securely using the session key
embedded in the service ticket.
30
2. Biometric Authentication Request (Step 1)
● When a user attempts to authenticate, instead of simply providing a password, they scan
their biometric traits (e.g., scan their fingerprint or face).
● The biometric system compares the user's input to the stored biometric data. If the
biometric match is successful, the user is considered authenticated at this stage.
3. Generate TGT Based on Biometric Verification (Step 2)
● After successful biometric verification, the system can proceed to the Kerberos
authentication process.
● The Authentication Server (AS) is now able to validate the biometric authentication in
addition to checking the user’s password (if applicable), or the user’s biometric data can
be used directly as an additional authentication factor.
● Once the biometric authentication is successful, the AS issues the Ticket Granting
Ticket (TGT), which is encrypted and includes a session key for secure communication.
4. Requesting Service Access (Step 3)
● The client can now request service tickets from the Ticket Granting Server (TGS) using
the TGT obtained during the biometric-based authentication.
● The TGS checks the validity of the TGT, and if valid, issues a Service Ticket that
contains a session key.
5. Accessing the Service (Step 4)
● The client presents the service ticket to the requested service for access.
● The service verifies the ticket using its secret key and grants the client access if the ticket
is valid.
● Secure communication continues between the client and service using the session key.
31
securely, integrated with existing infrastructure, and synchronized with Kerberos
authentication.
● Scalability: In a large enterprise environment, managing and securely storing biometric
data for many users can be challenging. Additionally, biometrics require specialized
hardware (e.g., fingerprint scanners, cameras), which can increase infrastructure costs.
Here’s a general workflow for how third-party authentication works in a system using Kerberos
v5:
1. Client Request to Authentication Server (AS):
● The client begins the authentication process by sending a request to the Authentication
Server (AS).
● This request typically includes the client’s username and a timestamp.
● The client is not sending a password directly over the network, but it is identified by the
AS, which has knowledge of the client’s secret key.
2. AS Responds with Ticket-Granting Ticket (TGT):
● The AS validates the client’s credentials (username, password, etc.) using its internal
database.
● If authentication is successful, the AS issues a Ticket-Granting Ticket (TGT) encrypted
with the client’s password.
● Along with the TGT, the AS sends a session key (shared between the client and the
KDC) and a lifetime for the ticket.
3. Client Requests Service Ticket from TGS:
● The client can now use the TGT to request access to a specific service from the
Ticket-Granting Server (TGS).
● The client sends the TGT to the TGS, indicating the target service it wants to access.
32
4. TGS Issues Service Ticket:
● The TGS decrypts the TGT, verifies its authenticity, and checks the client’s credentials.
● If everything is in order, the TGS issues a service ticket for the requested service.
● This service ticket is encrypted with the secret key of the target service, ensuring only
that service can decrypt it.
5. Client Accesses the Service:
● The client sends the service ticket to the target service it wants to interact with, along
with an authenticator (which contains a timestamp).
● The service decrypts the ticket using its secret key, verifies the client’s identity, and
grants access if everything matches.
● The service then uses the session key to communicate securely with the client.
❖Mutual Authentication:
Mutual Authentication is a process where both parties (typically a client and a server)
authenticate each other to ensure that neither party is impersonating the other. This is an
important security feature to protect against man-in-the-middle attacks, fraud, and unauthorized
access.
How Mutual Authentication Works:
1. Client Authentication (Server's Side):
○ The client connects to the server and requests a secure connection.
○ The server proves its identity by sending a certificate or using another means of
authentication (like a shared key, digital certificate, etc.).
○ The client verifies the server’s identity using a trusted third party (e.g., a
Certificate Authority or KDC in the case of Kerberos).
2. Server Authentication (Client's Side):
○ The server can also verify the client’s identity.
33
○ Typically, this involves the client proving knowledge of a secret (e.g., a password,
digital signature, or other credentials) through a challenge-response mechanism or
certificate-based methods.
○ Once both parties authenticate each other, they can establish a secure
communication channel.
Importance of Mutual Authentication:
● Prevention of Impersonation: Both the client and the server ensure they are
communicating with the intended party, protecting against identity theft.
● Confidentiality and Integrity: Once mutual authentication is complete, both parties can
exchange sensitive data over a secure channel (e.g., SSL/TLS encryption).
● Non-repudiation: Both parties have proof of who they communicated with, preventing
denial of actions or interactions.
Examples of Mutual Authentication:
● SSL/TLS (Web Browsing): SSL/TLS protocols often implement mutual authentication
by having both the client and server present certificates.
● Kerberos Authentication: As explained earlier, Kerberos ensures mutual authentication
by issuing tickets for both clients and services, validating both sides before granting
access.
❖Reflection Attack:
A Reflection Attack is a type of denial-of-service (DoS) attack where an attacker reflects a
request they receive from a legitimate user (or system) back to the original source in a malicious
way. The attack involves sending a response to a request that was not directly from the attacker,
but is instead targeted at another entity (usually the victim). This attack can be particularly
dangerous in the context of authentication protocols.
2. Step 2: Server Responds to the Victim: The server, believing the request originated
from the victim, sends a response (often a challenge or authentication request) back to the
victim’s IP address.
3. Step 3: Victim Receives the Malicious Response: The victim receives the server’s
response and might process it in a way that compromises their own system. In some
cases, this could lead to the victim inadvertently providing sensitive information,
triggering further attack vectors.
In simpler terms, the attacker reflects a message (or request) that appears legitimate to the server
but is designed to affect the victim who’s unaware of the manipulation.
Examples of Reflection Attacks:
1. DNS Reflection Attack: Attackers send DNS queries to open DNS resolvers with the
victim’s IP address as the source. The victim gets flooded with DNS responses.
34
2. Kerberos Reflection Attack: This occurs when an attacker attempts to reflect an
authentication request to the Key Distribution Center (KDC) to impersonate a legitimate
user. Since the attacker’s request appears to come from the victim, the KDC could issue a
service ticket for the victim, granting unauthorized access.
○ Enforcing that the source of a request must match the response address, and not
allowing spoofed IP addresses, can prevent many forms of reflection attacks.
5. Rate Limiting:
○ Limiting the rate of requests that can be made from a given IP can help mitigate
large-scale reflection attacks, particularly when flooding the victim with
responses.
6. Session Binding:
35