Cryptography III Flashcards

1
Q

What is the role of a Digital Signature?

A
  • it proves that a message is from a certain someone
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the goals for a Digital Signature?

A
  1. Authenticity
    - binds identity to a message
    - provides assurance of the signer
  2. Unforgeability
    - attacker cannot forge a signature for a diff identity
  3. Nonrepudiation
    - signer cannot deny signing a message
  4. Integrity
    -attacker cannot take A’s signature for a message and use it to sign another message
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does Digital Signing work with public-key encryption?

A
  • since the order of enc and decr can be reversed:
  • to get digital signature on M => decrypt plaintext message m with the secret key
  • knowing A’s PK, B can verify validity of S on M
  • B encrypts S with PK, checks if result is M
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does Digital Signature work with Hashes?

A

Sign: S = DSK (h(M))
Verify: h(M) == EPK (S)

  • combines security of sigital signature with Collision resistance property of hash functions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the issue with Encrypt then Sign? How to fix?

A
  • adversary can unsign and sign with own signature => reciever thinks the message comes from attacker

FIX: Sign then Encrypt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is MAC? what does it guarantee

A

= Message Authentication Codes
- similar to Dig Sign but SYMMETRIC
=> does not provide nonrepudiation (since whoever can verify can also sign)

-provides guarantee that message came from a certain sender and has not been changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Properties of MACs

A
  1. Unforgeability
    -even after seeing many MAC-message pairs, attacker cannot produce valid MAC for new M
  2. Integrity
    -if MAC or message altered, recipient can detect it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the ways to implement MACs?

A
  1. CBC-MAC
    - using a block cipher in CBC mode, encrypt message and use last cipher block as MAC
    - tweaks: fix IV to 0; prepend each message with its length
  2. HMAC
    - use HF, shared secret
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a possible attack on CBC-MAC?

A

an attacker knows two messages and their MAC tags:
Message 1: m=P[0],P[1] → MAC tag is t
Message 2: m′=P[0]′,P[1]′ → MAC tag is t’

create a fake message: m′′=P[0],P[1],P[0]′⊕t,P[1]′

=> last block is the correct MAC for tag t’ (valid tag)
=> this is a valid message (even if it might be basically garbage, attacker still shouldnt be able to impersonate someone)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is MAC-then-Encrypt (MtE)?

A

A cryptographic approach where a MAC is computed on the plaintext, then the message and MAC are encrypted together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the steps of MAC-then-Encrypt (MtE)?

A

Compute MAC(Message).
Append MAC to the message: Message || MAC.
Encrypt everything: E(Message || MAC).
Send the ciphertext.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why was MAC-then-Encrypt (MtE) used in TLS?

A

It was used to provide confidentiality and integrity in older versions of TLS, but it required special padding schemes to reduce vulnerabilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a major weakness of MAC-then-Encrypt (MtE)?

A

It does not protect the integrity of the ciphertext, making it vulnerable to modification attacks and padding oracle attacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is MAC-and-Encrypt (M&E)?

A

A cryptographic approach where the message is encrypted and MACed separately, then both the ciphertext and MAC are sent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the steps of MAC-and-Encrypt (M&E)?

A
  1. Encrypt the message: C = E(Message).
  2. Compute MAC on the plaintext: MAC = MAC(Message).
    3.Send (Ciphertext, MAC).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why is MAC-and-Encrypt (M&E) insecure?

A

The MAC is computed on the plaintext, so an attacker can compare MAC values to check if two messages are the same, even if encryption hides this information.

17
Q

What is a major weakness of MAC-and-Encrypt (M&E)?

A

It can leak message equality because identical plaintexts will have the same MAC, even if encryption prevents direct comparison.

18
Q

What is Encrypt-then-MAC (EtM)?

A

A cryptographic approach where a message is first encrypted, then a MAC is computed on the ciphertext.

19
Q

What are the steps of Encrypt-then-MAC (EtM)?

A
  1. Encrypt the message: C = E(Message).
  2. Compute MAC(Ciphertext): MAC = MAC(C).
  3. Send (Ciphertext, MAC).
20
Q

What security guarantees does Encrypt-then-MAC (EtM) provide?

A

Integrity and authenticity for both ciphertext and plaintext, preventing tampering and forgery.

21
Q

Why is Encrypt-then-MAC (EtM) recommended over MtE and M&E?

A

It ensures that any modification of the ciphertext is detected, protecting against tampering attacks.

22
Q

What is the purpose of the Diffie-Hellman key exchange?

A

Allow two parties to establish a shared secret key

23
Q

What are the main steps of the Diffie-Hellman key exchange?

A

A picks a secret x and computes X = f(x), then sends X.
B picks a secret y and computes Y = f(y), then sends Y.

Both compute the shared secret:
A : K = g(x, Y)
B : K = g(y, X)
Both now have the same key K without transmitting it directly.

24
Q

What information does an attacker see in a Diffie-Hellman exchange?

A

The attacker can capture X and Y, but cannot reconstruct the shared key K without knowing x or y.

25
Q

Why is Diffie-Hellman secure?

A

The security relies on the Discrete Logarithm Problem (DLP), which is computationally hard to reverse (i.e., deriving x from X = f(x) is very difficult).

26
Q

Can an attacker compute K from just X and Y?

A

No, because they would need to solve the Discrete Logarithm Problem, which is infeasible for large numbers.

27
Q

What is a common attack against Diffie-Hellman?

A

Man-in-the-middle attack (MITM), where an attacker intercepts X and Y, replacing them with their own values X and Y, to establish separate keys with each party.

28
Q

How can Diffie-Hellman be protected against MITM attacks?

A

By using authentication mechanisms like digital signatures or public key certificates to verify identities.

29
Q

What is a Merkle Tree?

A

Each node is a hash of its children, ensuring data integrity and efficient verification.

30
Q

How does a Merkle Tree ensure integrity?

A

It uses collision-resistant hash functions => a small change in data will produce a diff Merkle Root.

31
Q

How can one prove that a piece of data exists in a Merkle Tree?

A
  • Merkle Proof = authentication path (sibling hashes needed to compute the Merkle Root).
32
Q

Why is a Merkle Proof efficient?

A

Instead of sending the entire tree, you only need to send log(n) hashes, where n is the number of elements in the tree.

33
Q

How are Merkle Trees used in secure cloud storage?

A
  1. The Merkle Root is stored locally by the user.
  2. When retrieving a file, the cloud provider gives the file along with a Merkle Proof.
  3. The user verifies that the proof leads to the correct Merkle Root.
34
Q

How do Merkle Trees improve Certificate Transparency?

A
  • Web certificates are stored in a public Merkle Tree log.
  • Anyone can check if a certificate is valid by verifying its inclusion in the log.