Cs Ass2 Jahad
Cs Ass2 Jahad
(TEXT BOOK_ASSIGNMENT # 2)
Ans:
(Problem # 2.2)
Ans:
(1)
Digital Signatures (DS) and Message Authentication Codes (MAC) are
cryptographic techniques used to provide integrity, authentication,
and non-repudiation in communication. Let's discuss how DS and
MAC protect against various attacks in the scenario where an
eavesdropper, Oscar, can observe all messages sent between Alice
and Bob.
Digital Signatures (DS):
1. Data Integrity:
DS: Digital signatures provide data integrity by ensuring
(a)
If Alice sends the message x = "Transfer $1000 to Mark" and its
corresponding authentication code auth(x) to Bob, and Oscar
intercepts the message and changes "Mark" to "Oscar," Bob will
detect this. The authentication code is generated based on the
original message content, and any modification to the message will
result in a failed authentication.
(b)
If Alice sends the message x = "Transfer $1000 to Oscar" and its
authentication code auth(x) to Bob, and Oscar replays the same
message and authentication code multiple times, Bob will likely
detect this. Properly designed authentication mechanisms include
mechanisms to prevent replay attacks. For example, a timestamp or
nonce may be included in the message or signature to ensure
freshness.
(c)
If Oscar and Alice both claim to have sent the same message x with a
valid authentication code auth(x) to Bob, and Bob only has access to
the public key used for authentication, he cannot determine the true
sender. The authentication process only verifies the integrity of the
message and the possession of the private key corresponding to the
public key used for verification. It does not identify the entity that
originally generated the message.
(d)
If Bob claims to have received a message x with a valid signature
auth(x) from Alice, but Alice denies sending it, it becomes a dispute.
The digital signature only verifies the authenticity of the message
and does not reveal the content. In such a scenario, additional
evidence or a trusted third party may be needed to resolve the
dispute.
(Problem # 2.6)
Ans:
1. Preimage Resistance:
Given a hash value h, it should be computationally
3. Collision Resistance:
It should be computationally infeasible to find any two
4. Avalanche Effect:
A small change in the input message should produce a
5. Efficiency:
The hash function should be computationally efficient to
compute the hash value for any given input. This ensures
that the hashing process is practical and can be
performed in a reasonable amount of time.
6. Pseudo randomness:
The hash function should produce output that appears
8. Security Parameter:
The hash function should have a sufficient bit length
When a hash function produces 16-bit hash values, there are a total
of 2^16 (or 65,536) possible hash values. This means that there are
65,536 distinct hash values that can be generated by the hash
function.
The Birthday Paradox is a phenomenon in probability theory that
states that the probability of two different items having the same
value increases significantly as the number of items (in this case,
hash values) increases.
To find the number of random messages required to have a
significant probability of finding two messages M and M' such that
H(M) = H(M'), you can use the Birthday Paradox formula. The
formula is:
Number of messages ≈
√ Total Number of hash Values
2
Substituting in the given values:
Number of messages ≈
√ 65536
2
≈ √ 32768 ≈ 181.019
Therefore, you would need approximately 181 random messages to
have a 50% probability of finding two messages with the same hash
value. As you increase the number of random messages, the
probability of a collision (two different messages producing the same
hash value) increases.