CSS Module 3
CSS Module 3
Security of MAC
1. Nested MAC
In which hashing is done in two steps. In the first step, the
key is concatenated with the message and is hashed to create
an intermediate digest. In the second step, the key is
concatenated with the intermediate digest to create the final
digest.
HMAC
• NIST has issued a standard (FIPS 198) for a nested
MAC that is often referred to as HMAC (hashed
MAC, to distinguish it from CMAC).
• The implementation of HMAC is much more
complex than the simplified nested MAC.
• There are additional features, such as padding.
We go through the steps:
input Message
Initial
128-bit
vector
128-bit result
• MD5 (Message Digest Method 5) is a cryptographic
hash algorithm that generates a 128-bit digest from a
string of any length.
• The digests are represented as 32-digit hexadecimal
numbers.
• The digest size is always 128 bits, and thanks to
hashing function guidelines, a minor change in the
input string generates a drastically different digest.
• This is essential to prevent similar hash generation,
also known as a hash collision, as much as possible.
• In cryptography, MD5 ensures data integrity and
authenticity by generating unique hash values for distinct
data inputs.
• It converts arbitrary-sized data into a fixed-size 128-bit
hash, making it crucial for applications like digital
signatures, certificate generation, and data integrity
verification.
• By producing a consistent hash for the same input and
different hashes for even minor changes in input, MD5
helps detect data corruption and tampering.
• However, due to vulnerabilities like collision attacks,
where different inputs produce the same hash, MD5 has
diminished in favor of more secure algorithms like SHA-
256 for critical cryptographic applications.
How Does MD5 Algorithm Work
• Append length –
64 bit length of msg , len mod 264 , data to hash = [Msg + padding +len]
• Initialize MD buffer – chaining variable A,B,C,D – 32 bit no
• Process message in 512 bit blocks –
Four rounds of processing on
1.i/p 512 bit data divided into 16 blocks of 32 bit each X[i]
2.chaining variable
3. uses one fourth of element table T[1---64] constructed
from sin function 2^32 * abs(sin(i))\
4. process g (different for each round) F,G,H,I
MD5: Padding
1 2 3 4
input Message
512:
B1
512:
MD B2
5 512:
MD B3
5 512:
MD B4
5
MD
5
Result
Step 4.
Continued
(4 Rounds)
58
Step 4. Continued
59
Applications of MD5 Algorithm
• Data Integrity
• Digital Signatures
• Certificate Generation and Verification
• Password Storage
• Checksums and File Integrity
SHA-1
Secure Hash Algorithm (SHA)
+
ft
CL +
S5
Wt
+
CLS3
Kt
0 +
A B C D E
Basic Logic Functions
• Only 3 different functions
● User’s name
● Company or department of user
● IP (internet protocol) address or serial number of
device
● Copy of the public key from a certificate holder
● Duration of time the certificate is valid for
● Domain certificate is authorized to represent
Digital certificates can provide the following
benefits:
● Security: Digital certificates can keep internal and
external communications confidential and protect the
integrity of the data. It can also provide access control,
ensuring only the intended recipient receives and can
access the data.
● Authentication: With a digital certificate, users can be
sure that the entity or person they are communicating
with is who they say they are and makes sure that
communications reach only the intended recipient.
● Scalability: Digital certificates can be used across a
variety of platforms for individuals and large and small
businesses alike.
● They can be issued, renewed, and revoked in a matter
of seconds. They can be used to secure a range of user
devices and be managed through one centralized
system.
● Reliability: A digital certificate can only be issued by a
publicly trusted and rigorously vetted CA, meaning
that they cannot be easily tricked or faked.
● Public trust: The use of a digital certificate proves
authenticity of a website, documents, or emails. It can
assure users and clients that the company or individual
is genuine and respects privacy and values security.
How Do
Digital
Certificates
Work
Different types of digital certification