CSE4303 Introduction to Computer Security (Lecture 10)
MACs
MACs from Hash Functions
Construction:
If:
- is secure MAC for short messages
- is collision resistant
Then is secure MAC.
If collision exists: If , query tag for , forge .
HMAC
Used in:
- TLS
- IPsec
- SSH
Properties:
- Built from hash function (for example SHA-256)
- Provably secure under PRF assumptions
Timing Attacks on MAC Verification
Problem: Byte-by-byte comparison leaks timing information.
Attack:
- Send random tag.
- Guess first byte.
- Detect timing increase.
- Repeat per byte.
Defense 1: Constant-time comparison loop.
Defense 2: Double-HMAC comparison: Compare with .
Authenticated Encryption (AE)
AE provides:
- Confidentiality (CPA security)
- Ciphertext integrity
Cipher:
Ciphertext integrity: Attacker cannot produce new valid ciphertext.
Theorem: AE implies CCA security.
Implication:
If ,
receiver knows sender had key.
Encrypt-then-MAC
Correct construction:
- Compute
- Compute
- Send
Encrypt-then-MAC is always secure ordering.
AE Standards
- GCM: CTR mode encryption then polynomial MAC
- CCM: CBC-MAC then CTR mode encryption
- EAX: CTR mode encryption then CMAC
All support AEAD:
Authenticated Encryption with Associated Data.
Example: authenticate packet headers but do not encrypt them.
Asymmetric Crypto Authentication: Digital Signatures
Motivation
Goal: Bind document to author.
Digital problem: Anyone can copy a visible signature from one document to another.
Solution: Make signature depend on document contents.
Digital Signature Scheme
Components:
- Secret signing key
- Public verification key
- accept or reject
Property:
Anyone can verify.
Only signer can produce valid signature.
Signing a Certificate
Process:
- Compute hash of data.
- Sign hash with secret key.
- Attach signature to data.
Verification:
- Compute hash of received data.
- Verify signature using public key.
- Accept if hashes match.
Software Signing
Software vendor:
- Signs update with secret key.
- Publishes update and signature.
Clients:
- Use vendor public key.
- Verify signature.
- Install only if valid.
Allows distribution via untrusted hosting site.
Review: Three Approaches to Data Integrity
-
Collision resistant hashing
Requires secure read-only public space.
No secret keys.
Suitable for public verification. -
MACs
Requires shared secret key.
Must compute new MAC per user.
Suitable when one signs and one verifies. -
Digital signatures
Requires long-term secret key.
Public verification.
Suitable when one signs and many verify.
Crypto Summary
Cryptographic goals:
- Confidentiality
- Data integrity
- Authentication
- Non-repudiation
Primitives:
- Hash functions
- MACs
- Digital signatures
- Symmetric ciphers
- Public key ciphers