CNS Mid2
CNS Mid2
CNS-Mid2
Part A:
Definition: Fermat's Little Theorem states that if 'p' is a prime number and 'a'
is an integer not divisible by 'p', then a^(p-1) is congruent to 1 modulo 'p'
(written as a^(p-1) ≡ 1 (mod p)).
CNS-Mid2 1
Goal of Each Phase:
n = p * q = 19 * 23 = 437
φ(n) = (p - 1) * (q - 1) = 18 * 22 = 396
Part 2:
1. Euler’s Theorem:
CNS-Mid2 2
Cryptographic Hash Functions: These are one-way functions designed to
be collision-resistant, ensuring that it is computationally infeasible to find two
different inputs that produce the same hash output. They are widely used in
digital signatures and password hashing.
x ≡ 2 (mod 3)
x ≡ 3 (mod 5)
x ≡ 2 (mod 7)
y1 ≡ 105 / 3 ≡ 35 (mod 3)
y2 ≡ 105 / 5 ≡ 21 (mod 5)
y3 ≡ 105 / 7 ≡ 15 (mod 7)
CNS-Mid2 3
x ≡ (2 * 35 * 1) + (3 * 21 * 1) + (2 * 15 * 1) ≡ 2 + 63 + 30 ≡ 95 (mod 105)
Key Generation:
Encryption:
2. The sender uses the recipient's public key (e, n) to compute the
ciphertext 'c' as c ≡ m^e (mod n).
Decryption:
1. The recipient uses their private key (d, n) to compute the original
message as m ≡ c^d (mod n)
CNS-Mid2 4
provide both confidentiality and authentication for data transmitted over
IP networks.
1. Input Size:
2. Output Size:
CNS-Mid2 5
bytes) and serves as a unique representation of the input
message.
3. Collision Resistance:
4. One-Way Function:
5. Security:
CNS-Mid2 6
Diagram:
The diagram visually demonstrates the processing steps of the SHA-512
algorithm, where the input data undergoes several rounds of
mathematical operations to produce the 512-bit message digest. The
complexity of these operations enhances the security of the hash
function, making it suitable for various cryptographic applications.
CNS-Mid2 7
Reduced Risk of Key Exposure: Using long-term keys for multiple
sessions increases the risk of key exposure if any one of the
sessions is compromised. Session keys reduce this risk by being
unique for each session, limiting the scope of potential damage if a
key is compromised.
1. Authentication:
Each party sends a request to the KDC along with their identity
or digital certificate to prove their authenticity.
The KDC encrypts the session key twice: once using A's long-
term encryption key and once using B's long-term encryption
key.
The KDC sends the two encrypted copies of the session key
back to parties A and B.
Each party can decrypt the session key meant for them using
their respective long-term encryption keys.
Now both parties have the same session key without ever
having directly shared it with each other.
4. Secure Communication:
Parties A and B can use the session key to encrypt and decrypt
their communication during the current session.
CNS-Mid2 8
By using the KDC to securely distribute session keys, parties can
establish secure communication without the need for direct key
exchange, ensuring confidentiality, authentication, and efficiency in their
communication.
CNS-Mid2 9