Anyone who tries to create his or her own cryptographic primitive is either a genius or a fool. Given the genius/fool ratio of our species, the odds aren’t very good.
Bruce Schneier
Current Events: Experian
Experian: US credit score service.
Past month:
- Accounts were being hijacked
- Hypothesis: if you create a new account created with an existing user’s account details (e.g. email), you can get access to their details
- Experian denied allegations, even after researchers hacked their own accounts
- Class action lawsuit filed
Principles
Security protocols are more than passwords.
At the core, security protocols are about preventing malicious people from doing bad things.
Security protocols exist outside of software:
- Accessing a building with a card
- Making sure you get the wine you paid for, not some cheap substitute
- Accessing your car or house with a key
Eavesdropping risks:
- Lurked PINs on your credit card/phone
- Amplified then stolen encrypted car key codes
- Vaccine pass QR codes
Simple Authentication Principle
Notation:
Where:
-
is a token -
is an access gateway (e.g. garage door) -
is a nonce - a single use, unique number used to prevent replay attacks -
is an encryption key -
is the encrypted value of and with key - The LHS of the colon denotes communication between entities (sender/receiver)
The nonce is used to prevent replay attacks.
Challenge and Response
Often used by car transponders:
Where:
-
is the engine controller -
is the car key transponder (e.g. RFID, radio) -
is a nonce -
is the encrypted value of and with key
Early 2FA
Where:
-
is the server -
is the user -
is the password generator -
is the nonce/random challenge generated by the server -
is the user’s PIN/password -
is the key stored on the password generator and server -
is the encrypted value of the nonce and PIN with key
Physical 2FA Devices
A physical device is used to generate authentication numbers:
- Chap authentication program (CAP): challenge-response with key and mask
- One time password (OTP): psuedo-random password generated on a device, or via SMS
Generation algorithm (protocol):
- Requires clock synchronization between the device and remote server
- Previous values (i.e. sequence to avoid replay attack) or challenge
Reflection Attack
Adversary finds a legitimate ‘password’ generator and then performs a MITM attack.
Where:
-
is the server -
is the user -
is the adversary
Failures
Failures are often in the protocol:
- CAP button overloaded: allowed repeat transactions with amount = 0
- Attackers could social engineer the code from the users (who believe it is safe), then use the code to perform non-zero amount transactions
- OTP only checked against previous passcode
- If you had two cards, you could simply switch between them?
- SSL/TLS encrypt data, but endpoints/metadata can leak data
- Key fob cloning (repeat attack):
- Some car keys would broadcast the same key continuously, allowing an attacker in range of the signal to later replay the same signal to unlock the car
- Simple solution: use a counter; value must be strictly increasing
Reducing the amount of failures:
- Use the right math for the right purpose
- Ensure encryption keys are kept secret
- Ensure keys can be revoked
General Encryption Principles
Where:
-
is the plain text and is the encrypted text -
is the encryption function and the decryption function -
is the encryption key and is the decryption key
Examples:
-
: symmetric keys (e.g. AES) -
: particular derived keys (e.g. flashed on micro-controllers)
Cipher Examples
Ceasar Cipher:
-
whereis the plaintext, is the encryption key and is the encrypted character - Weakness: frequency analysis
Vernam cipher:
- Bit-by-bit symmetric encryption with a key
that is as long as the plaintext -
whereis the encrypted bit and is the plaintext bit - Theoretically unbreakable if the keystream is truly random and only used once
- But does not ensure integrity: attacker can flip bits. If they know the data structure, they may be able to flip specific bits for harmful effects
Playfair block cipher:
- Simple shift-based block cipher
- Frequency analysis can be performed using repeating blocks
- Hence, transformations are applied to the plaintext to prevent repeated blocks
Feistel cipher:
- Ladder structure with multiple rounds applied to each half of the plaintext
- Round function
applied to RHS - Result XORed with LHS
- Swap left and right, then repeat
- Round keys usually derived from one master key
Hash functions and control keys:
- Used to check the integrity of messages
- Initially used with wired telegraph payments using a codebook
- e.g. SHA-1, SHA-256
Key Management
User-defined keys are relatively weak:
- Not enough entropy: key needs to be larger
- Using proof of a common secret: vulnerable to replay attacks
- Public key encryption: how can you trust the public keys you receive?
Public key infrastructure:
- Have a chain of trust, hard-coding trust for one or more root certificates
- Trust models for CAs:
- Separate domains: one root CA
- Cross-certification/mesh: each CA issues cross-certificates to each other
- Cross certification: each CA issues certificate to the other, allowing devices which trust only one of them to trust certificates signed by the other
- Requires
certificates
- Bridge-CA model: one central bridge CA which cross-certifies with each CA