Cryptographic Hash Functions Overview
Cryptographic Hash Functions Overview
Reference Notes
Module 3
Subject Name: Cryptography & Network Security
Subject Code: BCS703
Faculty
Dr. Roopa M J, Associate Professor
Mrs. Shilpashree S, Assistant Professor
Semester: VII
Module 3
The specific kind of hash function required for security applications is called a cryptographic hash
function. This type of algorithm has properties that make it computationally infeasible (meaning no
attack is significantly more efficient than brute force) to achieve certain goals:
These characteristics make cryptographic hash functions ideal for determining whether data has been
altered.
● Typically, the input message M is padded to become an integer multiple of a fixed block length
(e.g., 1024 bits).
● This padding usually includes the value of the original message's length in bits. This length field
is a crucial security measure that increases the difficulty for an attacker to create an alternative
message that produces the same hash value.
This chapter will first explore the diverse applications of cryptographic hash functions, then detail their
security requirements, examine how cipher block chaining can be used to implement them, and finally,
focus on the Secure Hash Algorithm (SHA) family, which is the most widely used.
Message Authentication
Vulnerability without Protection: If a hash value is simply transmitted alongside the message without
protection, an adversary can easily perform a "man-in-the-middle" attack (Figure 11.2b). In this scenario,
Alice sends a message M and its hash H(M). Darth intercepts M, alters it to M′, calculates a new hash
H(M′), and replaces H(M) with H(M′). Bob receives M′ and H(M′), computes H(M′) himself, finds a
match, and remains unaware of the alteration.
● Necessity of Hash Value Protection: To prevent such attacks, the hash value must be protected
in a way that makes it infeasible for an adversary to alter it alongside the message.
Figure 11.3: Simplified Examples of the Use of a Hash Function for Message Authentication
illustrates several ways to protect the hash value and provide message authentication:
○ Only the hash value H(M) is encrypted using a symmetric secret key K: E(K,H(M)).
Advantages of Avoiding Encryption for Authentication (Method c vs. a/b/d): There has been
increasing interest in techniques like Figure 11.3c that avoid full message encryption for authentication.
Reasons [TSUD92] include:
● Slower Encryption Software: Encryption, even for small data, can be slow, which is an issue for
continuous message streams.
● Non-negligible Hardware Costs: Implementing encryption hardware at all network nodes can be
costly.
● Encryption Hardware Optimization: Encryption hardware is often optimized for large data
sizes, leading to high initialization overhead for small blocks.
● Patent/Licensing Costs: Encryption algorithms may be patented, incurring licensing fees.
● Message Authentication Code (MAC) / Keyed Hash Function:
○ More commonly, message authentication is achieved using a Message Authentication
Code (MAC), also known as a keyed hash function.
○ A MAC function takes a secret key and a data block as input, producing a fixed-size hash
value (the MAC) associated with the message.
○ Integrity Check: The receiver applies the same MAC function to the message using the
shared secret key and compares the result with the received MAC.
○ Security: An attacker without knowledge of the secret key cannot alter the message and
produce a valid MAC, thus protecting integrity.
○ Authentication: The verifying party also knows the sender's identity because only that
sender (and the receiver) possess the secret key.
○ Relationship to Encryption+Hashing: The combination E(K,H(M)) (Figure 11.3b) is
functionally a MAC. However, dedicated MAC algorithms are generally more efficient
than general encryption algorithms. (MACs are discussed in Chapter 12).
Digital Signatures
○ The hash code H(M) is encrypted using the sender's private key PRa: E(PRa,H(M)).
○ The message M is sent in plaintext, accompanied by the encrypted hash.
○ Authentication & Digital Signature: Only the sender (A) has PRa, so only A could
have produced E(PRa,H(M)). This verifies the sender's authenticity and provides a
non-forgeable digital signature.
○ Verification: Any party can use A's public key PUa to decrypt the hash
D(PUa,E(PRa,H(M)))=H(M), then compute H(M′) from the received message and
compare.
● Operation: This is one of the simplest hash functions. It computes the bit-by-bit XOR of every
block of the input.
○ Ci=bi1⊕bi2⊕⋯⊕bim
○ Where:
■ Ci=ith bit of the hash code (for 1≤i≤n)
■ m=number of n-bit blocks in the input
■ bij=ith bit in jth block
■ ⊕=XOR operation
● Result: This operation produces a simple parity bit for each bit position. It is also known as a
longitudinal redundancy check (LRC).
● Effectiveness for Random Data: It is reasonably effective as a data integrity check for truly
random data. Each n-bit hash value is equally likely. The probability that a data error will result in
an unchanged hash value is 2−n.
● Effectiveness for Predictable Data: Less effective for predictably formatted data. For example,
in many text files, the most significant bit (high-order bit) of each octet (byte) is always zero. If a
128-bit hash value is used, and 16 bits are derived from each octet's high-order bit, then the
effectiveness for this specific kind of data reduces from 2−128 to 2−112 (as 16 bits are always
zero, effectively reducing the hash size).
● Improvement: A simple way to improve the basic XOR hash is to perform a one-bit circular
shift (rotation) on the current hash value after each input block is processed.
● Procedure:
1. Initialize the n-bit hash value to zero.
2. For each successive n-bit block of data: a. Rotate the current hash value to the left by one
bit. b. XOR the current data block into the rotated hash value.
● Effect: This procedure aims to "randomize" the input more completely and overcome regularities
in the input data, making the hash function appear more robust. (Figure 11.5 illustrates both
simple XOR and RXOR).
Why These Simple Hash Functions Are Insecure for Data Security
Even with the rotation, these simple hash functions are virtually useless for data security applications,
especially when an encrypted hash code is used with a plaintext message (as in Figures 11.3b and 11.4a,
where only the hash is encrypted or signed).
● Vulnerability to Chosen Message Attack: Given a desired hash code (or even just the original
message), it's extremely easy for an attacker to produce a new message that yields that same hash
code.
○ Method: The attacker can prepare their desired alternate message. They then simply
append an n-bit block (the final block) that, when XORed into the hash of the preceding
blocks, forces the overall hash of the new message plus this final block to equal the target
hash code. This directly violates the collision-resistant property required for
cryptographic hash functions.
● Vulnerability Even with Full Encryption (Figure 11.3a - CBC Mode Example):
○ One might think that if the message and the hash code are fully encrypted (e.g., using
Cipher Block Chaining (CBC) mode, as proposed by the National Bureau of Standards
for a 64-bit block XOR hash), security would hold.
○ Scheme (NBS Proposal):
■ Message M is split into 64-bit blocks X1,X2,…,XN.
■ Hash code h=XN+1=X1⊕X2⊕⋯⊕XN.
■ The entire message plus hash (X1,…,XN,XN+1) is then encrypted using CBC
mode to produce ciphertext Y1,Y2,…,YN+1.
○ Vulnerability (as pointed out by [JUEN85]): The ciphertext of this message can be
manipulated without detection by this simple hash code due to properties of CBC mode
and XOR.
■ Recall CBC decryption: Xi=Yi−1⊕D(K,Yi) (and X1=IV⊕D(K,Y1)).
■ The hash code is XN+1=X1⊕X2⊕⋯⊕XN.
■ Substituting the CBC decryption formula into the hash formula:
XN+1=[IV⊕D(K,Y1)]⊕[Y1⊕D(K,Y2)]⊕⋯⊕[YN−1⊕D(K,YN)]
■ Problem: Because XOR is associative and commutative, the terms in the
expression for XN+1 can be reordered. This means that if the ciphertext blocks
(Y1,Y2,…,YN) are permuted by an attacker, the calculated hash code XN+1
would not change. The receiver would decrypt the permuted blocks, compute
the hash, and find it matches the (unchanged) XN+1, leading to undetected
alteration of the message's block order. This is a critical failure for integrity.
● Cascading Compromise (Option 3): If an attacker compromises even one key, all subsequent
keys transmitted using that compromised key will also be revealed. Additionally, the initial
distribution of potentially millions of keys remains an issue.
A common and widely adopted solution for end-to-end encryption is using a Key Distribution Center
(KDC).
● Mechanism: A KDC is responsible for distributing session keys to pairs of users (hosts,
processes, applications) as needed. Each user (or end system) must share a unique master key
with the KDC.
● Key Hierarchy (Figure 14.2): This approach relies on a two-level key hierarchy:
○ Session Keys: Temporary keys used for encrypting communication between end systems.
They are typically used for the duration of a logical connection (e.g., a frame relay or
transport connection) and then discarded.
○ Master Keys: Long-lasting keys shared between an end system/user and the KDC.
Session keys are transmitted in encrypted form, using the relevant master key.
● Reduced Distribution Problem: The scale of master key distribution is significantly reduced.
For N entities, only N master keys are needed (one per entity shared with the KDC), compared to
N(N−1)/2 session keys. These master keys can be distributed via non-cryptographic, physical
means.
This scenario illustrates a typical key distribution process where each user shares a unique master key
with the KDC.
Assumptions:
Steps:
1. A to KDC (Request): A sends a request to the KDC: IDA || IDB || N1.
○ IDA, IDB: Identities of A and B.
○ N1: A unique identifier (nonce) for this transaction (e.g., timestamp, counter, random
number). It must be difficult for an opponent to guess to prevent masquerade and replay
attacks.
2. KDC to A (Response): The KDC generates a session key Ks and sends a message encrypted
with A's master key Ka: E(Ka, [Ks || IDA || IDB || N1]) || E(Kb, [Ks || IDA]).
○ For A:
■ Ks: The one-time session key.
■ IDA || IDB || N1: The original request message (including nonce), allowing A to
verify the response against the request and detect replays.
○ For B (encrypted with Kb):
■ Ks: The one-time session key.
■ IDA: Identifier of A.
○ This entire message ensures A knows it's from the KDC and gets its Ks. The second part
is for A to forward to B.
3. A to B (Forwarding K_s): A stores Ksand forwards the part intended for B: E(Kb, [Ks || IDA]).
○ Since it's encrypted with Kb, only B can decrypt it.
○ B now knows Ks, knows the other party is A (from IDA), and trusts the origin (KDC, due
to encryption with Kb).
4. B to A: B sends a new nonce N2, encrypted with the new session key Ks: E(Ks, N2). This assures
A that B has the correct session key and is live.
5. A to B: A responds with f(N2), encrypted with Ks: E(Ks, f(N2)), where f is a simple
transformation (e.g., adding one). This assures B that A has the correct session key and is live,
and that step 3 was not a replay.
● Key Distribution: Steps 1-3.
● Authentication: Steps 3-5 (Step 3 authenticates the KDC to B and A to B; Steps 4-5 mutually
authenticate A and B using the new session key).
● Scalability: For very large networks, a single KDC might not be practical. A hierarchy of KDCs
can be established (e.g., local KDCs for domains, a global KDC for inter-domain
communication).
● Benefits:
○ Minimizes Master Key Distribution: Most master keys are local to a KDC and its
entities.
○ Limits Damage: A compromised KDC's impact is limited to its local domain.
● Security vs. Performance: More frequent session key exchange increases security (less
ciphertext for an opponent per key) but introduces overhead and delays. A balance is needed.
● Connection-Oriented Protocols: Typically, a new session key per connection. For long-lived
connections, changing the key periodically (e.g., after a PDU sequence number cycle) is prudent.
● Connectionless Protocols: No explicit connection. New key for each exchange is most secure
but adds overhead. A better approach is to use a key for a fixed period or a certain number of
transactions.
This approach provides end-to-end encryption at the network or transport layer, transparent to end users,
for connection-oriented protocols (e.g., TCP). It uses a Session Security Module (SSM).
● SSM Function: An SSM (e.g., a protocol layer component) handles end-to-end encryption and
obtains session keys for its host/terminal.
● Connection Establishment Steps:
1. Host A sends connection-request packet.
2. SSM buffers packet. SSM asks KDC for a session key (communication encrypted with
master key shared between SSM and KDC).
3. KDC distributes session key. If approved, KDC generates and securely delivers the
session key to both communicating SSMs.
4. Buffered packet transmitted. The requesting SSM releases the buffered packet, and the
connection is set up.
● Ongoing Communication: All user data is then encrypted by the respective SSMs using the
one-time session key.
● Benefit: Provides dynamic and flexible key distribution for many users and hosts.
● Requirement: Each end system must be able to securely communicate with all potential partner
end systems for session key distribution. This implies each node needs to maintain (N−1) master
keys (one for each potential partner), or N(N−1)/2 master keys for the entire system.
● Session Key Establishment (between A and B):
1. A to B (Request): A sends IDA || N1 (nonce) to B.
2. B to A (Response): B generates a session key Ks and sends a message encrypted with
their shared master key Km: E(Km, [Ks || IDA || IDB || f(N1) || N2]).
■ Ks: Session key chosen by B.
■ IDA, IDB: Identities.
■ f(N1): Transformation of A's nonce (for anti-replay).
■ N2: B's nonce.
3. A to B (Confirmation): A decrypts the message, gets Ks, and sends E(Ks, f(N2)) to B
(using the new Ks).
● Benefits: Avoids the single point of failure/trust of a KDC. Short messages exchanged using
master keys make cryptanalysis difficult.
● Drawbacks: Requires a large number of master keys for each node in a large network.
Beyond key hierarchy, it's desirable to control how automatically distributed keys are used.
● Key Types: Different session keys can be defined based on their purpose:
○ Data-encrypting key: For general network communication.
○ PIN-encrypting key: For PINs in financial transactions.
○ File-encrypting key: For files in public storage.
● Risk of Misuse: If a master key is accidentally used or imported as a data-encrypting key, it
could expose plaintext session keys.
● Control Mechanisms:
1. A generates keys & sends public key to B: Alice (A) generates a public/private key pair
(PUa,PRa) and sends her public key PUaalong with her identifier IDAto Bob (B).
2. B generates secret key & sends encrypted to A: Bob generates a secret (symmetric) key Ksand
encrypts it using Alice's public key: E(PUa,Ks). Bob transmits this encrypted message to A.
3. A recovers secret key: Alice decrypts the message using her private key: D(PRa,E(PUa,Ks)) to
recover Ks. Since only Alice possesses PRa, only A and B know Ks.
4. A & B discard keys: Alice discards PUaand PRa, and Bob discards Ks(used for transmission
only).
● Pros: Simplicity, no pre-existing keys required, keys are ephemeral (discarded after use), making
compromise risk minimal. Communication is secure from eavesdropping.
● Cons: Insecure against Man-in-the-Middle (MITM) Attack [RIVE84]: This protocol is
vulnerable if an adversary (E) can intercept, relay, or substitute messages.
5. Eve re-encrypts with Alice's key & sends to Alice. Eve encrypts Kswith Alice's original public
key E(PUA,Ks) and transmits it to Alice.
6. Alice receives & learns Ks. Alice decrypts E(PUA,Ks) using her PRAto obtain Ks.
● Result: Both Alice and Bob believe they share Ks, but Eve also knows Ks. Alice and Bob will
communicate using Ks, unaware that Eve can decrypt all their messages.
● Conclusion: This simple protocol is only secure against eavesdropping; it provides no protection
against active MITM attacks.
1. A to B (Request for Shared Secret): A uses B's public key PUBto encrypt a message containing
A's identifier IDAand a nonce N1(to uniquely identify the transaction and prevent replays):
E(PUB,[N1∣∣IDA]).
2. B to A (Confirmation & New Nonce): B decrypts message (1). B sends a message to A
encrypted with A's public key PUA, containing A's nonce N1(to assure A that B received the
correct message) and a new nonce N2generated by B: E(PUA,[N1∣∣N2]).
○ Authentication: The presence of N1in message (2) assures A that the correspondent is
indeed B, because only B could have decrypted message (1) to retrieve N1.
3. A to B (Confirmation of B's Nonce): A returns N2(received from B) to B, encrypted using B's
public key PUB: E(PUB,N2).
○ Authentication: This assures B that its correspondent is A, because only A could have
correctly decrypted message (2) and retrieved N2.
4. A to B (Secret Key Distribution): Alice selects a secret key Ks. She then sends it to B,
encrypted with both B's public key and her own private key (for signature/authentication):
E(PUB,E(PRA,Ks)).
○ Confidentiality: Encryption with PUBensures only B can read Ks.
○ Authentication: Encryption with PRAensures only A could have sent the message,
providing a digital signature.
5. B recovers secret key: Bob decrypts the message: first with his private key PRBto get
E(PRA,Ks), then with Alice's public key PUAto recover Ks.
● Result: This scheme securely exchanges Kswith both confidentiality and authentication.
This approach combines elements of KDC-based symmetric key distribution with public-key encryption
for master key distribution, creating a three-level hierarchy.
● Traditional KDC Core: Retains a Key Distribution Center (KDC) that shares a secret master key
with each user. The KDC distributes symmetric session keys encrypted with these master keys (as
in the previous section).
● Public-Key Layer for Master Keys: A public-key scheme is used specifically for the
distribution and periodic update of these master keys.
● Rationale for Three-Level Approach:
○ Performance: Public-key encryption is computationally intensive. For applications with
frequent session key changes, directly using public-key encryption for every session key
would degrade performance. By using public-key encryption only occasionally to update
master keys, and symmetric encryption for frequent session keys, efficiency is
maintained.
○ Backward Compatibility: This hybrid scheme can be easily integrated into existing
KDC infrastructures with minimal disruption or software changes.
● Advantage: This provides a secure and efficient means of distributing master keys, especially
beneficial for configurations where a single KDC serves a widely distributed set of users.
● Public announcement
● Publicly available directory
● Public-key authority
● Public-key certificates
● Concept: The simplest approach is for individuals to simply broadcast or announce their public
key to anyone. Given that public keys are designed to be public, this seems intuitive. For
example, PGP users often append their public key to messages sent to public forums like Usenet
newsgroups or mailing lists.
● Weakness: This method is highly insecure due to the lack of authentication.
○ Forgery: Anyone can generate a public/private key pair and pretend to be another user
(e.g., User A). They can then announce this forged public key as if it belongs to User A.
○ Consequences: Until the real User A discovers the forgery and alerts others, the impostor
can:
■ Read all encrypted messages intended for the real User A (by encrypting with the
forged public key).
■ Use the forged keys to digitally sign messages, impersonating User A for
authentication purposes.
Public-Key Authority
● Concept: This method provides tighter control over public key distribution from a central
directory, offering stronger security. It assumes each participant reliably knows the public key of
the central authority, and only the authority knows its corresponding private key.
● Scenario (Request-Response Protocol):
1. A to Authority: Alice (A) sends a timestamped message to the public-key authority,
requesting Bob's (B's) current public key. (Request || T1)
2. Authority to A: The authority responds with a message encrypted using its private key
(PRauth).
■ E(PR_auth, [PU_b || Request || T1])
■ Authentication: A decrypts this using the authority's public key (PUauth),
assuring A that the message originated from the trusted authority.
■ Contents: Includes B's public key (PUb), the original request (for A to match the
response and verify no alteration), and the timestamp T1(to ensure currency and
prevent replay of old keys).
3. A to B (Initiating Communication): A stores B's public key and encrypts a message for
B containing A's identifier (IDA) and a nonce N1: E(PU_b, [IDA || N1]).
4. B to Authority: B retrieves A's public key from the authority in the same manner as A
did for B (steps 1 & 2 for B and A respectively): (Request || T2), followed by
E(PR_auth, [PU_a || Request || T2]).
● Mutual Authentication (Desired Additional Steps): Once both A and B have each other's
public keys: 6. B to A: B sends a message to A, encrypted with A's public key (PUa), containing
A's nonce N1and a new nonce N2generated by B: E(PU_a, [N1 || N2]). *
Authentication: Only B could have decrypted message (3) to get N1, so A is assured the
correspondent is B. 7. A to B: A returns N2, encrypted using B's public key (PUb): E(PU_b,
N2). * Authentication: This assures B that its correspondent is A.
● Efficiency: A total of seven messages are required for a first-time secure exchange. However,
public keys can be cached for future use, reducing subsequent exchanges to steps 3, 6, and 7.
Users should periodically request fresh copies to ensure currency.
Public-Key Certificates
● Concept: This approach, first suggested by Kohnfelder [KOHN78], aims to overcome the
bottleneck and vulnerability of a centralized public-key authority. It uses certificates to allow
participants to exchange keys reliably without constant contact with the authority.
● What is a Certificate? A certificate essentially bundles a public key and its owner's identifier,
and this entire block is digitally signed by a trusted third party, typically a Certificate Authority
(CA) (e.g., a government agency or financial institution).
● Process:
○ A user securely presents their public key to a CA and obtains a certificate.
○ The user can then publish this certificate (e.g., on a website, in an email signature).
○ Anyone needing this user's public key can obtain the certificate and verify its validity
using the CA's well-known public signature.
○ A participant can also send their certificate directly to another participant.
● Requirements for a Certificate Scheme:
○ Readability: Any participant can easily read a certificate to get the owner's name and
public key.
○ Origin Verification: Any participant can verify that the certificate genuinely originated
from the CA and has not been tampered with.
○ CA Exclusivity: Only the CA can create and update certificates.
● Additional Requirement (Denning [DENN83]): 4. Currency Verification: Any participant can
verify the currency (freshness/validity period) of the certificate. This is crucial to prevent replay
attacks with compromised old keys.
● Certificate Structure (Example):
○ A CA provides a certificate of the form: Cert_A = E(PR_auth, [T || ID_A
|| PU_a])
○ PRauth: Private key of the Certificate Authority.
○ T: Timestamp.
○ IDA: Identifier of User A.
○ PUa: Public key of User A.
● Verification:
○ The recipient uses the CA's public key (PUauth) to decrypt the certificate: D(PU_auth,
E(PR_auth, [T || ID_A || PU_a])).
○ Successful decryption verifies the certificate's origin (only the CA could have signed it).
○ ID_A and PUaprovide the owner's name and public key.
○ The timestamp T validates the certificate's currency. This counters scenarios where a
private key is compromised, a new certificate is issued, but an attacker replays the old
(compromised) certificate. If the old certificate is used for encryption, the attacker can
still read messages. The timestamp acts like an expiration date.
● Standardization: The X.509 standard has become universally accepted for formatting
public-key certificates. X.509 certificates are widely used in network security applications like
IPsec, TLS, and S/MIME. The next section will delve into X.509.
X.509 specifically defines a framework for authentication services provided by the X.500 directory to its
users. Crucially, the directory can serve as a repository for public-key certificates, similar to those
discussed in the previous section. Each certificate contains a user's public key and is digitally signed using
the private key of a trusted Certification Authority (CA). X.509 also outlines alternative authentication
protocols that leverage these public-key certificates.
Importance: X.509 is a cornerstone standard because its defined certificate structure and authentication
protocols are widely adopted in various security contexts, including S/MIME (email security), IP Security
(IPsec), and SSL/TLS (web security).
Evolution:
Underlying Cryptography:
1. Unsigned Certificate: Contains user ID and the user's public key.
2. Generate Hash Code: A hash function (H) is applied to the unsigned certificate.
3. Encrypt Hash Code (Signature): The hash code is encrypted with the CA's private key (PRCA)
to form the digital signature.
4. Signed Certificate: The signature is appended to the unsigned certificate.
5. Verification (Recipient Side):
○ The recipient applies the same hash function to the received unsigned certificate.
○ The recipient decrypts the received signature using the CA's public key (PUCA) to
recover the original hash code.
○ The recipient compares the newly computed hash code with the recovered hash code. If
they match, the signature is valid, and the recipient trusts the certificate's authenticity.
Certificates
The core of the X.509 scheme is the public-key certificate issued to each user.
● Version: Indicates the certificate format version (1, 2, or 3). Version 2 is required if unique
identifiers are present. Version 3 is required if extensions are present.
● Serial Number: An integer unique within the issuing CA, unambiguously identifying this
certificate.
● Signature Algorithm Identifier: Specifies the algorithm (e.g., RSA with SHA-256) used by the
CA to sign the certificate. (This information is redundant as it's repeated in the final signature
field).
● Issuer Name: The X.500 name of the CA that created and signed the certificate.
● Period of Validity: Consists of two dates: "Not Before" (start date) and "Not After" (end date),
defining the certificate's validity period.
● Subject Name: The X.500 name of the entity (user, host, etc.) whose public key is being certified
by this certificate.
● Subject's Public-Key Information: Contains the subject's public key, along with an identifier of
the algorithm it's intended for (e.g., RSA, DSA) and any associated parameters.
● Issuer Unique Identifier (Optional - Version 2+): A bit string to uniquely identify the issuing
CA if its X.500 name has been reused.
● Subject Unique Identifier (Optional - Version 2+): A bit string to uniquely identify the subject
if its X.500 name has been reused.
● Extensions (Version 3+): A set of one or more optional fields providing additional information.
These are discussed in detail below.
● Signature: A digital signature over all other fields of the certificate. It consists of a hash of the
other fields, encrypted with the CA's private key. This field also includes the signature algorithm
identifier.
Verification: If a user knows the CA's public key, they can verify a certificate signed by that CA. This is
the standard digital signature process.
● Verifiability: Any user with access to the CA's public key can verify the public key contained
within the certificate.
● Integrity: No party other than the CA can modify the certificate without detection.
● Storage: Because certificates are unforgeable, they can be stored in a directory without special
protection.
Trust Model (Single CA): If all users trust the same CA, all user certificates can be placed in a directory
for common access. A user can also directly transmit their certificate to another. Once B has A's
certificate, B can confidently:
For large user communities, a single CA might be impractical. Multiple CAs can exist, each providing its
public key securely to a subset of users.
Certification Path (Chain of Certificates): If Alice (A) trusts CA1and Bob (B) trusts CA2, but A does
not directly trust CA2, A can still obtain B's public key if CA1 and CA2 have securely exchanged their
public keys (i.e., issued certificates for each other).
1. A gets CA2's certificate from CA1: A obtains CA1≪CA2≫ from the directory. Since A
securely knows CA1's public key, A can verify the signature and trust CA2's public key.
2. A gets B's certificate from CA2: A then obtains CA2≪B≫ from the directory. Since A now
trusts CA2's public key, A can verify the signature and securely obtain B's public key.
● Arbitrary Length Chains: This scheme extends to chains of arbitrary length, e.g.,
X1≪X2≫X2≪X3≫…XN≪B≫. Each pair of CAs in the chain must have cross-certified each
other.
● X.509 Hierarchy (Figure 14.15): X.509 suggests arranging CAs in a hierarchy for
straightforward navigation.
○ Users can "unwrap" a certification path by starting with a trusted CA, using its public key
to verify the next certificate in the chain, extracting the next CA's public key, and
repeating until the target user's public key is obtained.
Revocation of Certificates
Certificates have a period of validity. However, they may need to be revoked before expiration for reasons
like:
1. Compromised Private Key: The certificate owner's private key is believed to be compromised.
2. User No Longer Certified: The CA no longer certifies the user (e.g., name change, certificate
superseded, policy non-conformance).
3. CA Compromised: The CA's own certificate (and thus its signing private key) is believed to be
compromised.
● Certificate Revocation Lists (CRLs): Each CA maintains and publishes a Certificate
Revocation List (CRL).
○ CRLs contain all revoked but not yet expired certificates issued by that CA (both user and
other CA certificates).
○ CRLs are signed by the issuing CA and posted to the directory.
○ CRL Format (Figure 14.14b): Includes the issuer's name, creation date, next scheduled
CRL issue date, and entries for each revoked certificate (serial number and revocation
date).
● User Behavior: When a user receives a certificate, they must check if it has been revoked. Users
typically maintain a local cache of certificates and CRLs to avoid constant directory lookups.
Version 2 of X.509 was found insufficient for new requirements. Version 3 introduced optional
extensions to provide flexibility.
● Each extension has an identifier, a criticality indicator (TRUE if unrecognized extensions make
the certificate invalid, FALSE if they can be safely ignored), and an extension value.
Categories of Extensions:
○ Private-Key Usage Period: Defines the validity period for the private key corresponding
to the public key, which may differ from the public key's validity.
○ Certificate Policies: Lists the security policies that the certificate is recognized as
supporting (e.g., for specific transaction types).
○ Policy Mappings: Used in CA certificates to indicate that one of the issuing CA's
policies is equivalent to a policy in the subject CA's domain.
2. Certificate Subject and Issuer Attributes:
○ Provide alternative names or additional descriptive information for the subject or issuer.
○ Subject Alternative Name: Allows multiple names or different formats (e.g., email
address, URL) for the subject, important for applications using non-X.500 identifiers.
○ Issuer Alternative Name: Similar to subject alternative name, but for the issuer.
○ Subject Directory Attributes: Conveys any desired X.500 directory attributes for the
subject (e.g., postal address, job title, picture).
3. Certification Path Constraints:
○ Allow CAs to impose restrictions on certificates issued by subordinate CAs or on
subsequent certificates in a chain.
○ Basic Constraints: Indicates if the subject of the certificate is a CA. If so, it can specify a
maximum path length for certificates issued by that CA (limits depth of hierarchy).
○ Name Constraints: Defines a name space (e.g., a domain) within which all subject
names in subsequent certificates in a certification path must reside.
○ Policy Constraints: Specifies constraints that may require explicit certificate policy
identification or inhibit policy mapping for the remainder of the certification path.
Principal Objective: To enable the secure, convenient, and efficient acquisition of public keys.
PKIX Working Group: The Internet Engineering Task Force (IETF) Public Key Infrastructure X.509
(PKIX) working group has been instrumental in establishing a formal, generic model based on X.509 for
deploying a certificate-based architecture on the Internet. This section details the PKIX model.
The PKIX model defines the interrelationships among several key elements:
● End Entity: A broad term for end users, devices (e.g., servers, routers), or any entity identifiable
in a public key certificate's subject field. End entities are the consumers and/or supporters of PKI
services.
● Certification Authority (CA): The core component responsible for issuing certificates and
typically Certificate Revocation Lists (CRLs). CAs may also handle administrative functions,
often delegating them to Registration Authorities.
● Registration Authority (RA): An optional component that can take on various administrative
functions from the CA. RAs are often involved in the end entity registration process, verifying
identities before a certificate is issued by the CA.
● CRL Issuer: An optional component to which a CA can delegate the task of publishing CRLs.
This offloads the CA's publication burden.
● Repository: A generic term for any mechanism (e.g., directory service, web server) used to store
certificates and CRLs, making them accessible for retrieval by end entities.
PKIX identifies several crucial management functions that require support through defined protocols:
● Registration: The initial process where a user makes themselves known to a CA (directly or via
an RA) before receiving a certificate. This involves mutual authentication, often through offline
or online procedures, and may result in the issuance of shared secret keys for subsequent
authentication. It's the starting point for enrolling in a PKI.
● Initialization: Before a client system can operate securely within the PKI, it must be securely set
up with necessary key materials. This typically involves securely installing the public key and
other verified information of trusted CA(s) to enable validation of certificate paths.
● Certification: The process where a CA issues a certificate for a user's public key. This certificate
can then be returned to the user's client system and/or published in a repository.
● Key Pair Recovery: For key pairs used for encryption/decryption, a mechanism is needed to
recover decryption keys if normal access (e.g., due to forgotten passwords, corrupted storage,
hardware token damage) is lost. This function allows end entities to restore their
encryption/decryption key pair from an authorized backup facility, usually the CA that issued the
certificate.
● Key Pair Update: All key pairs require regular updates (replacement with new pairs) and new
certificate issuance. Updates are necessary when a certificate's lifetime expires or if a certificate is
revoked.
● Revocation Request: An authorized individual or system requests a CA to revoke a certificate
due to abnormal situations. Common reasons include private-key compromise, changes in
affiliation, or name changes.
● Cross Certification: This function involves two CAs exchanging information to establish a
cross-certificate. A cross-certificate is a certificate issued by one CA to another CA, containing
the latter CA's signature key that it uses for issuing certificates. This builds trust paths between
different CA hierarchies.
The PKIX working group has defined two primary alternative management protocols to support the
aforementioned functions:
○ It is built upon existing cryptographic message structures and aims to utilize existing
implementations.
○ While it supports all PKIX functions, these functions do not always map directly to
specific, distinct protocol exchanges as they do in CMP.
Pseudorandom functions (PRFs) contribute to cryptographic processes by generating securely random outputs that appear indistinguishable from true randomness and are derivable from secret values. They are commonly used in encryption schemes, to secure communication by ensuring that each session or data transmission is unique, thereby maintaining confidentiality and security across different interactions .
CRLs enhance the digital communication trust model by listing certificates that are no longer valid before their expiration date due to issues like compromised keys or policy changes. This list is signed by the issuing CA and posted to directories, ensuring that any participant can verify the status of a certificate. By checking these lists, users prevent using outdated or compromised credentials, thus maintaining a robust and trusted authentication framework .
Protection of the hash value is vital because, without it, an adversary can perform a man-in-the-middle attack by intercepting a message, altering its contents, and generating a new hash for the modified message. The new hash replaces the original, and when the receiver recomputes and checks it against the compromised hash, it remains undetected. Securing the hash value ensures that any modification will be detected, maintaining message integrity .
Digital signatures in public-key certificates support non-repudiation by using the sender's private key to sign data, which ties the action specifically to the sender. Since only the owner possesses the private key, any repudiation claim can be refuted by showing the signed data and public key verification. This provides irrefutable proof of sender's intent and approval, essential in legal contexts like contracts or critical transactions, reinforcing accountability and security in digital ecosystems .
Choosing between full message encryption and encryption-free methods involves considering the computational overhead of encryption algorithms which might be slow, especially in continuous streams, the potential non-negligible hardware and licensing costs, and message confidentiality needs. Encryption-free methods can provide faster authentication at reduced cost while maintaining integrity via shared secret keys and hash functions—best suited for applications where message confidentiality is less critical but integrity and authenticity are essential .
Encrypting the entire message and its hash (M||H(M)) using a symmetric secret key enhances both authentication and confidentiality. Since the entire block is encrypted, only the sender and receiver, who share the key, can access the content, ensuring both parties' authenticity. This provides a layer of confidentiality absent if only the hash is encrypted, where the message remains in plaintext, thus reducing security against eavesdropping. Furthermore, encrypting only the hash might allow interception or manipulation of the message content itself, while encrypting both ensures integrity by detecting any alterations to the message alongside ensuring its confidentiality .
Storing hashed passwords instead of plaintext enhances security by ensuring that even if an attacker gains access to the password file, they only retrieve the hash values. Since cryptographic hash functions are one-way, it becomes extremely difficult to recover the original passwords from these hashes, thereby protecting user credentials from being easily compromised .
Authority key identifiers in X.509 certificate extensions support efficient key management by identifying the specific public key used by the CA to sign a certificate or CRL. This is particularly useful during CA key updates, ensuring that entities receiving a certificate can easily verify the correct CA key, which also assists in resolving ambiguities when multiple keys exist for a CA. This feature enhances trust and continuity in cryptographic operations .
Digital signatures use asymmetric cryptography, where the hash value of a message is encrypted with the sender's private key, providing proof of origin that the sender cannot later deny, known as non-repudiation. This contrasts with MACs, which are symmetric and use a shared secret key, meaning that either party could have produced the MAC, making non-repudiation harder to achieve since the sender can always claim the receiver forged the message .
X.509 certificates build reliability in network security by embedding the public key with the user's identity in a digitally signed bundle by a Certificate Authority, improving the integrity and authenticity of digital communications. Version 3 extensions further enhance this framework by allowing detailed specifications about key usage, policy information, and additional subject/issuer data. They enable more flexible security applications and maintain backward compatibility with systems using older version certificates, addressing evolving security requirements like cryptographic key management and alternative subject identifiers .