École Internationale de Printemps Systèmes Répartis : METIS’2008 Architecture, Sécurité & Fiabilité Rabat, 20-23 Mai 2008
- Prof. Gildas Avoine
Solutions pour la Scurit des rseaux Prof. Gildas Avoine UCL - - PowerPoint PPT Presentation
cole Internationale de Printemps Systmes Rpartis : METIS2008 Architecture, Scurit & Fiabilit Rabat, 20-23 Mai 2008 Solutions pour la Scurit des rseaux Prof. Gildas Avoine UCL Belgium Introduction Confidentiality,
École Internationale de Printemps Systèmes Répartis : METIS’2008 Architecture, Sécurité & Fiabilité Rabat, 20-23 Mai 2008
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Issues are real and have significant consequences.
Cost (direct, indirect). Image of the company. Competitive intelligence.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Locksmiths don’t secure
According to Thucydide:
Attack the weakest link.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
We focus on the communication security. Symmetric-key Authentication Public-key Authentication SSL/TLS (public key, many-to-one) WEP (symmetric key, many-to-one) Kerberos (symmetric key, many-to-many) PGP (public key, many-to-many)
Passwords One-Time Passwords Challenge-Response
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Identification: We identify a person or entity, that is
Authentication: We get a proof that the person we
Example, when log-on: we use the username for
Authentication can be done with the help of:
Something he possesses (token). Something he is (biometrics). Something he knows (password, key).
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Password: human-memorizable.
Issue: weak entropy.
Keys: used by computers, not by humans.
Issue: where to store them.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Passwords are never stored as such. The risk of theft
Instead of passwords, we store a hash.
Resistant to first preimage. Resistant to second preimage. Resistant to collision. Random oracle.
When logging in, the hashed
h message (pwd) hash ciphertext E plaintext key
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
123456
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Win NT/2000/XP uses the NT Lan Manager Hash
Passwords can be longer than 14 characters (but
Lowercase letters are not converted to uppercase. The hash function is MD4
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Win98/ME uses the Lan Manager Hash (LM hash). The password is cut in two blocks of 7 characters
Lowercase letters are converted to uppercase. A separate hash is generated for each 7-char block. The 7 bytes block are used as DES keys to encrypt an
0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
By default, LM Hash and NT Hash are both stored on
We can deactivate the creation of LM hash:
Require to modify the registry. Deactivated by default in Windows Vista. Choosing a pwd longer than 14 char desactivates the LM
Hash.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Online Attack
The system is used as an oracle (black box). Slow. How to avoid such an attack?
Offline Attack
We recover the passwords offline. Need to steal the hash file. How to avoid such an attack?
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The hash file is encrypted, but by default the key can
If the machine is running we need administrator
If we can boot another OS, we can steal and decrypt
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Percent Length 0.93% 13-32 0.93% 12 2.7% 11 13% 10 17% 9 25% 8 23% 7 15% 6 1.1% 5 0.82% 1-4
Source: www.schneier.com
1.3% numbers only 8.3% non-alphanumeric 81% alphanumeric 9.6% letters only
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Based on common dictionary words
Including dictionary words that have been altered:
Reversed (e.g., “terces”) Mixed case (e.g., SeCreT) Character/Symbol replacement (e.g., “$ecret”) Words with vowels removed (e.g., “scrt”) Numbers concatenated to word (e.g., “house123”)
Based on common names. Based on user/account identifier. Short (under 6 characters). Based on keyboard patterns (e.g., “qwerty”). Composed of single symbol type (e.g., all characters). Resemble license plate values.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Top-used passwords are (in order): “We used to quip that ‘password’ is the most common
password1, abc123, myspace1, password, blink182, qwerty1, fuckyou, 123abc, baseball1, football1, 123456, soccer, monkey1, liverpool1, princess1, jordan23, slipknot1, superman1, iloveyou1, monkey.
Source: www.schneier.com
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
mAI-2On MAI2SON MAISONT 8 7 6 100 days 100 days 1.2 days LM Spec 5 h 5 h 9 m alphanum 33m 33 m 77 s alpha
Windows LM Hash mAI-2On MAI2SON MAISONT 8 7 6 196 years 1.7 years 5.7 days UNIX Spec 630 days 10 days 3.9 h alphanum 14 days 33 m 77 s alpha
Unix (56 bits DES)
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Written down passwords. Shoulder surfing. Social engineering. Key logger, Rootkit. Eavesdropping the network. Multi-website passwords. Audit trails. Guessing the password (low entropy).
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
A chain of hashes is generated. The last element (hn) is provided to the verifier. The first element (h1) is provided to the prover. To authenticate himself, the prover sends hn-1 to the
Nobody is able to compute hn-1 except the prover.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
A challenge sent by the verifier is encrypted by the
The secret never transits on the channel. The password is hashed to generate a key. c Ek(c) Verifier Prover
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Certificate Gildas Avoine
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla Signature by Gildas Public key Signature by trusted party Trusted Party Public key Signature by trusted party Root Certificate
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
X.509: Standard from International
Then IETF RFC-2459 (and updates). Three required fields: TBS Certificate (TBS = “To Be Signed”)
The useful payload of the certificate (see next slide).
Signature algorithm
Identifier for the cryptographic algorithm used by the
CA to sign this certificate.
Signature value
Signature of the certificate by the CA.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Serial number
Unique number assigned by the CA to the certificate.
Issuer field
Identifies the entity who has signed and issued the certificate.
Subject
Identifies the entity associated with the public key (O:organization,
C: country, OU: Organization Unit, CN: common name eg. DNS, ST: state, L: city, etc. no IP address).
Validity
Not before, not after.
Subject Public Key Info
Public key and identify the algorithm with which the key is used
(e.g., RSA, DSA, or DH)
Etc.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Certificate: Data: Version: 3 (0x2) Serial Number: 10 (0xa) Signature Algorithm: sha1WithRSAEncryption Issuer: C=BE, O=Kingdom of Belgium, OU=Federal Public Service Foreign Affairs Belgium, CN=CSCAPKI_BE Validity Not Before: Apr 10 00:00:00 2006 GMT Not After : Jul 15 23:59:59 2011 GMT Subject: C=BE, O=Kingdom of Belgium, OU=Federal Public Service Foreign Affairs Belgium, CN=DSPKI_BE Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (2048 bit) Modulus (2048 bit): 00:8f:9c:2c:f8:05:b5:bd:ed:51:1a:9f:b0:57:6e: 86:53:07:46:ac:ab:b6:05:e7:d6:e8:a6:6a:7b:ba: 9b:27:aa:8a:9f:80:ec:87:b3:9d:68:b7:29:cb:b1: df:de:5e:48:9e:34:21:9f:97:ea:98:7a:f7:f6:88: 1c:ca:a3:b1:3f:b2:d8:36:9a:06:0b:b3:f0:02:20: ce:ff:a9:e2:12:00:b2:1d:71:df:3e:cc:64:83:e2: f9:e8:30:15:a5:62:95:ab:8e:8c:ee:dc:73:9a:9f: 58:78:c9:38:fd:ae:7c:71:17:73:c8:64:23:d2:34: 99:58:ef:bc:ca:dc:e3:38:39:d4:30:16:c1:8e:52: a9:b0:eb:7f:5f:06:65:02:bc:72:1e:eb:14:40:af: 39:20:25:48:cf:2f:8e:1b:4f:2e:d6:fb:49:b7:ab: a3:e5:56:2e:31:a1:30:56:69:dc:4f:b4:d8:49:a4: af:e6:0c:e8:65:df:58:d5:ee:7f:80:02:d5:35:63: 2a:14:81:0a:eb:7d:5e:17:f8:63:9a:67:28:b0:b8: f4:39:0b:cb:91:63:4b:e3:14:e0:69:dd:dd:92:26: b2:8b:a4:0c:4d:de:10:b8:96:2b:e7:f1:ac:2e:2f: 11:15:bd:13:1d:61:c4:bf:69:24:28:9f:67:dd:b6: 49:b5 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Authority Key Identifier: keyid:00:84:19:14:B2:CE:7E:0A:DE:3A:26:F9:FD:DD:1F:F4:01:42:A8:0E X509v3 Key Usage: critical Digital Signature Signature Algorithm: sha1WithRSAEncryption 5d:ed:53:da:14:3d:e2:ab:2d:41:3c:ea:bc:55:3b:78:2a:2c: 8e:0b:54:74:af:bd:a9:e1:c5:92:a4:f0:db:a9:0b:7d:0c:96: …
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Issuers of certificates found
Source:
www.securityspace.com
Verisign, GeoTrust, and
Thawte: same group.
7.64 Comodo Limited 0.79 Snake Oil Ltd 0.85 SWsoft Inc 0.86 Chained SSL 1.22 SomeOrganization 1.51 AddTrust AB 1.61 Entrust.Net 1.85 Unkown 2.76 Starfield Technologies 15.21 Thawte 19.56 GeoTrust (Equifax) 29.25 Verisign
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
1.
Each new participant must present himself.
2.
The CA (physically) authenticates the participant.
3.
It asks the participant to generate a pair of public/private keys.
4.
It creates a certificate with the participant’s identity, his public key, an expiry date, etc. and the CA’s signature.
5.
It provides a copy of its own public key to the participant.
6.
The new participant can communicate with all other participants who share a common “trusted ancestor”.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Advantages ? Drawbacks ?
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Client-server communications, random client,
Authentication of server based on public key. Trusted third party: certificate authority (CA).
client server eavesdropping fake server fake client Modifying
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The most widely deployed security protocol in the
SSL was developed by Netscape to offer secure
History
SSL v1.0 never publicly released. SSL v2.0 released in 1994 (flawed). SSL v3.0 released in 1996, leads to TLS 1.0 (1999).
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
TLS is an IETF’s standard based on SSL v3.0:
Slight modifications compared to SSL v3.0. TLS v1.0 and SSL v3.0 do not interoperate. TLS v1.0 sometimes called SSL v3.1. TLS v1.0 defined in RFC 2246.
Current approved version:
TLS v.1.1 Released in 2006 RFC 4346 Fixes a vulnerability discovered by Vaudenay.
Next proposed version:
TLS v.1.2 Draft expires Sept 2008, may lead to RFC 4492.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Data Link Physical Layer Network Transport SSL Application
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Either create a new protocol from an existing
Examples: HTTP (80) / HTTPS (443), FTP (21) / FTPS (990),
SMTP (25) / SMTPS (995), POP3 (110) / POP3S (995), IMAP (143) / IMAPS (993).
Disadvantage: only clients supporting TLS can connect Advantage: we are sure that the communication are secure.
Or extend a protocol to negotiate SSL/TLS:
Examples: (E)SMTP, POP3, IMAP, with the help of the
STARTTLS command the client can ask to use TLS.
Advantage: the client is not required to support TLS to use
the service.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
HTTPS
The use of TLS or not is not negotiable. Guarantees confidentiality of transmitted data and
authenticity (server, possibly client).
The server must have a certificate The client can have one (eg eBanking)
HTTPS
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
For initializing a session For setting-up cryptographic algorithms For managing warnings and fatal errors For passing data from an application to the record layer in a transparent manner
Processing data
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Processing of data:
Fragmentation Compression (optional) Authentication Encryption
It delivers such processed fragments to the
At the receiving end, the inverse operations are
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Data Data Data MAC MAC Encrypted Data and MAC Encrypted HEADER HEADER
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Encryption is performed on compressed and
Block ciphers:
DES (40 bits or 56 bits), 3DES, IDEA, RC2 (40 bits) Why 40-bit key alternative? AES (128 bits or 256 bits) in TLS v1.1
Stream ciphers:
NULL, RC4 (40 bits or 128 bits).
The client should refuse 40-bit keys if such a cipher
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Negotiation of:
The protocol version (SSL 3.0, TLS 1.0, TLS 1.1). The algorithms:
Key exchange (RSA, Diffie-Hellman). Encryption (DES, 3DES, IDEA, RC4, RC2, AES). MAC (HMAC-MD5, HMAC-SHA). The client proposes the desired algorithms in order of
preference, the server chooses.
Optional authentication of the partner using a
Messages are not encrypted. Last messages authenticate the exchange.
Introduction to WLAN WEP Description Attacks on WEP (Theory) Attacks on WEP (Practice)
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Access points connect to wired network. Multiple mobile stations per Access Point.
Full internet connection for mobile users.
University campus. Coffee shops. Airport lounges.
W i r e d n e t w
k
Access Point (AP) Mobile Devices
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Wireless stations communicate directly, without a
On the fly networking.
Impromptu meeting. Rescue operations.
LAN set up is difficult.
Natural areas.
LAN set up is dangerous.
Battle field. People are not aware that they launch an ad hoc
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Typical use inside: ~30m Typical outdoor range with suited antenna: ~5 km. Record: 382 km by EsLaRed of Venezuel (2007).
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Just discovering WiFi
To war-drive:
Laptop 802.11 card Software GPS Car
While you drive:
Listens and builds map of
all WiFi networks found.
Examples:
www.wigle.net www.wardriving.com
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Source: www.wigle.net
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Authentication
Open systems Do not broadcast AP’s SSID MAC address filter WEP WPA / WPA2
Encryption
WEP WPA / WPA2
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
No authentication at all. Less and less used?
Usually, providers impose authentication by default.
Not the case with Belgacom (Observed in 2007).
Public free hot spots without authentication. Non-free hot spots in hotels, train stations, etc.
High Level Authentication (eg. RADIUS Server).
Communities sharing their access.
What kind of problem do we face?
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The AP broadcasts its SSID. Allow clients to dynamically
discover the AP.
Can be used to authenticate a client Client must know the SSID. Not secure because SSID can be
eavesdropped.
When a legitimate client connects
to the AP.
Can be used to restrict features.
People pay to activate the wireless feature of their router. Lack of broadcast can be due to the channel number.
Do not broadcast the SSID.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
In practice, snif the environment with eg. Kismet,
Kismet in a Linux shell
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The router has a list of authorized MAC addresses.
The router checks the MAC address of the station trying
to connect to the network.
Attacker can read MAC address of a legitimate wireless
station and replace his own MAC address with the stolen
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
MAC addresses of the devices connected to the AP
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Authentication ("shared key" user authentication). Confidentiality (RC4 stream cipher encryption). Integrity checking (CRC-32 integrity mechanism). No key management. No protection against replay attacks.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
WEP = Wired Equivalent Privacy. Part of 802.11 Standard (1999) The stated goal of WEP is to make wireless LAN as
According to Tanenbaum:
“The 802.11 standard prescribes a data link-level security
protocol called WEP (Wired Equivalent Privacy), which is designed to make the security of a wireless LAN as good as that of a wired LAN. Since the default for a wired LAN is no security at all, this goal is easy to achieve, and WEP achieves it as we shall see.”
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Key A Key A Key A Key A
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
In practice:
Key is loaded in device by hand when set up.
Often keep manufacturer’s default.
Printed under the router, in the user guide, etc.
Never updated again.
Same key for everybody:
In a large network, users may wish to have independent
secure connections. Just a single non-honest WLAN user can break the security.
Static key:
Since it is relatively easy to crack WEP encryption in a
reasonably short time (see next slides), the keys should be changed often, but the preshared key concept does not support this.
Belgacom’s default WEP keys… (64 bits)
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The adversary can “replay” a packet she has already
Solutions?
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Integrity is ensured using a CRC. CRC does not provide a cryptographic integrity check.
CRC designed to detect random errors. Not designed to detect intelligent changes.
In WEP, the message is concatenated to the CRC,
The encrypted message can be modified s.t. it is still valid
after decryption.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
MAC address Challenge (128 bytes) Response (encrypted) Status code Authentication is successful, if WEP decryption gives original challenge text
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
plaintext secret key ciphertext
Stream Cipher keystream
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
plaintext secret key ciphertext
RC4 keystream
checksum IV
24 bits 40 bits
IV
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Designed by Ron Rivest (MIT) in 1987 for RSA Labs.
Kept as a secret trade until 1994. Publicly disclosed in Sept. 1994 on Cypherpunks’ mailing list.
Bytes-oriented
Generate keystream byte at a step
Efficient in software (compared to LFSR, Block Ciph.).
Encryption in software is about 10 times faster that DES. Simple and elegant.
Widely used:
Commercial softwares as MS Office, Oracle Secure SQL. Network protocols as SSL, IPSec, WEP. Copy protection: inside MS XBOX.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Not under the spotlights as all other stream ciphers. Theoretical attacks. Weak keys. To be used carefully.
Remove the first bytes (e.g. the first 768 bytes) to avoid
some attacks…
Do not encrypt too long stream to avoid other attacks… If plaintext and ciphertext known, then keystream known.
No problem if keystream is not reused. If keystream reused, at least as bad as reuse of one-time pad.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
WEP uses 24-bit (3 byte) IV.
Each packet gets a new IV. RC4 packet key: IV pre-pended to long-term key, K.
If long-term key and IV are same, then same
There is a 50% chance of key-reuse after 212 packets
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Keystream leaks, under known-plaintext attack.
Suppose we intercept a ciphertext C, and suppose we can
guess the corresponding plaintext P
Let Z = RC4(K, IV) be the RC4 keystream Since C = P ⊕ Z, we can derive the RC4 keystream Z by P ⊕
C = P ⊕ (P ⊕ Z) = Z
This is not a problem ... unless keystream is reused!
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
CRC is a linear function wrt to XOR:
Attacker observes (M | CRC(M)) ⊕ K where K is the
For any ∆M, the attacker can compute CRC(∆M). Hence, the attacker can compute:
Example: Modify an IP address
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Fluhrer, Mantin, and Shamir (FMS) – 2001
Two years only after WEP was published. Some IVs are weak, ie, they allow to guess some internal
states, leading to the key.
IV and first byte of plaintext/ciphertext must be known.
IV is sent in the clear. Ciphertext is eavesdropped. First bytes of ARP or TCP are fixed or can be easily
guessed.
4 million IVs to recover a 128-bit key. Number of IVs linear with the key-length (vs exponential) Key is revealed byte after byte (sequentially)
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Korek - 2004
Proposed 17 attacks based on FMS. New classes of weak IVs. 1 million IVs. 2 bytes must be observable.
Tews, Weinmann, Pyshkin (PTW) - 2007
Still new classes. 80’000 IVs. More bytes must be observable Variant by Vaudenay/Vuagnoux (32’000 IVs) Key bytes are no longer necessarily guessed sequentially.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
WEP data encrypted using RC4.
Packet key is IV and long-term key K.
3-byte IV is pre-pended to K. Packet key is (IV,K).
IV is sent in the clear (not secret).
New IV sent with every packet. Long-term key K never changed.
Assume Trudy (=attacker) knows IVs and
Trudy wants to find the key K.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
3-byte IV pre-pended to key. We denote the RC4 key bytes: K0,K1,K2,K3,K4,K5,…
Where IV = (K0,K1,K2), which Trudy knows Trudy wants to find K3,K4,K5,…
Attack due to Fluhrer, Mantin, and Shamir:
Trudy watches IVs until she sees 3-byte IV of the form:
IV=(K0,K1,K2) = (3,255,X) where X can be anything.
Then RC4 key for this packet is key = (3,255,X,K3,K4,K5,…)
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
KSA (Key-Scheduling Algorithm)
Initialization Scrambling
PRGA (Pseudo-Random Generation Algorithm)
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
… … Ki i K4 K3 X 255 3 4 3 2 1
i=3, j=(5+X)+(1)+K3=6+X+K3 i=2, j=3+S2+K2=3+2+X=5+X i=1, j=3+S1+K1=3+1+255=3 [N] i=0, j=0+S0+K0=0+0+3=3
initial state
… 1 … 2 … 4 6+X+K3 5+X 3 i=3 … 6+X+K3 … 2 … 4 1 5+X 3 i=2 … 6+X+K3 … 5+X … 4 1 2 3 i=1 … 6+X+K3 … 5+X … 4 2 1 3 i=0 … 6+X+K3 … 5+X … 4 3 2 1 init … 6+X+K3 … 5+X … 4 3 2 1 i\S
Scrambling j = 0 For i = 0 To N-1 j = (j + Si + Ki) mod N Swap(Si,Sj) Initialization //N=256 For i = 0 To N-1 Si = i
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Assumption: 6+X+K3 > 5+X (mod N).
Otherwise 6+X+K3 will be to the left of 5+X.
Up to now, we have only considered the first 4 steps
In reality, there are 256 steps.
For now, assume that initialization stops after i = 3. So, outputted keystream is:
PRGA //init i=j=0 i = (i + 1) mod N = 1 j = (j + Si) mod N = S1 = 0 Swap(Si, Sj) Swap(S1, S0) Output S(Si+Sj) mod N Output S3 = 6+X+K3
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Note: keystreamByte = 6+X+K3. If keystreamByte is known, we can solve for K3 since
But initialization does not stop at i=3. So can this “attack” really work?
If elements at 0,1 and 3 not swapped in remaining
initialization steps, attack works.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Can Trudy really recover the key?
If she sees enough IVs she gets K3.
Suppose Trudy has found K3.
Then how to find K4?
Consider IVs of the form: IV = (4,255,X).
Then after initialization step i=4, one could show that:
And so on…
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Client IP Discovery phase. (Flooding). Sniffing IV’s and keystreams. Key cracking.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
AirCrack-ng
http://www.aircrack-ng.org Implement Korek, PTW (needs ARP flooding). Available eg in BackTrack.
WepCrack
http://sourceforge.net/projects/wepcrack/ “WEPCrack is a tool that cracks 802.11 WEP encryption keys
using the latest discovered weakness of RC4 key scheduling.”
Last version: Oct 2004
AirSnort
http://airsnort.shmoo.com/ Last update: 2005. Implement Korek’s attacks.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
How do users prove their identities when requesting
Solution: every server knows every user’s password.
Insecure: break into one server may compromise all users. Inefficient: passwords must be changed on every servers. Not convenient: passwords must be typed for each request.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
User proves his identity and requests a credential. Trusted third party provides a credential to the user. Credential is supplied to get the expected service.
The credential aka ticket is an identity proof but does not necessarily give the ability to use a given service.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Hypotheses:
There is an online (trusted) authentication server (AS). AS shares KC with client C. AS shared KS with server S.
Goal:
To help C and S to share a session key K.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Identity of the Client Identity of the Server
Source of the picture: Vaudenay’s lecture notes, EPFL, 2005
The client can give the server’s key to other clients.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
An attacker can replace Ic by IA
Source of the picture: Vaudenay’s lecture notes, EPFL, 2005
A solution consists in not revealing the server’s key: AS encrypts itself the session key K with the server’s key. “sealed envelop”
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Source of the picture: Vaudenay’s lecture notes, EPFL, 2005
Replay attack by impersonating AS if K is compromised, due to careless users: no means to be sure that K is fresh.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Source of the picture: Vaudenay’s lecture notes, EPFL, 2005
Replay attack by impersonating C if K is compromised, due to careless users: no means to be sure that K is fresh.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The name Kerberos comes from Greek mythology.
It is the three-headed dog that guarded Hades’ entrance.
Created at the MIT, free of charge.
Kerberos 4 (1988), obsolete. Kerberos 5 (1993), RFC 1510, then RFC 4120 (2005).
Deployed:
Initially on Unix systems. Used in many commercial products eg Windows from 2K.
Based on symmetric-key cryptography.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Once you log into a workstation after authentication,
Kerberos software on the workstation will finish the
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
C S AS TGS 5 6 4 3 1 2
Client C. Authentication server AS
a.k.a. KDC (key distribution center)
Ticket granting server TGS. Server S which the client wants to access to. 1- Request a Ticket Granting ticket 2- Provide a Ticket Granting Ticket 3- Request a Ticket for a given service 4- Provide a Ticket for a given service 5- Forward the Ticket 6- Provide a service
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
To access a service, the client must have a ticket for
The user can get this ticket from the Ticket Granting
The service ticket confirms that the user can access
The Ticket Granting Ticket (TGT) only confirms the identity
The client shows a ticket + an authenticator.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The ticket contains:
Ic: the client’s identity. v: validity period. Kc,s: symmetric session key to be used between the client and
the server.
Others: Flags, IP address, etc.
It is encrypted with the key of the server Ks. The authenticator is just the client’s identity and a
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
C S AS TGS 1 2
To start, the user must authenticate at the AS to
C sends his name and the name of the TGS he wants
The AS replies with a Ticket Granting Ticket
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The user types his username and password on his
The client applies a one-way function (in practice a
Server’s keys are random bit-strings.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
C S AS TGS 4 3
The client sends the ticket as well as an
The ticket contains the session key Kc,tgs.
The TGS uses the session key to verify the
The TGS knows whether C is authorized to access the
The TGS delivers a ticket to access the service.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
C S AS TGS 5 6 The service ticket again contains the client’s identity,
The client has also received a copy of the session key,
He sends an authenticator and the ticket to the
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
It is the client's responsibility to store his
The authentication server is accessed only once
Clients can access services with their tickets even if
Once a client is authenticated, his ticket cannot be
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The developers of Kerberos propose an analogy
You get a three-pass ski (TGT) from your travel agency
against a proof of identity (and money…).
Then, the three-day ski pass (TGT) can be used at four
different resorts. You show the pass at whichever resort you decide to go (until it expires), and you receive a lift ticket (ST) for that resort.
Once you have the lift ticket (ST), you can ski all you want at
that resort (until it expires).
If you go to another resort later, you once again show the
three-pass ski (TGT), and you get another lift ticket (ST) for the new resort.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
S/MIME.
Hierarchical. Users trust a certification authority.
PGP.
Peer-to-peer. Users trust some other users. One or several identities (names, e-mail addresses). One or several signatures per identity.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Mime (Multipurpose Internet Mail Extensions) is a
A Mime document at least contains the following two
Mime-version. Content-type.
text/plain text/html image/gif video/mpeg multipart/mixed etc.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
S/Mime proposed by RSA Security in 1997, S/Mime
S/Mime adds digital signature and encryption to Mime
S/Mime exclusively uses X.509 certificates, signed
Thus, before using S/Mime we have to obtain a
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
gildas.avoine@uclouvain.be; Wed, 30 Apr 2008 01:04:21 +0200 (CEST)
smtp4.sgsi.ucl.ac.be (Postfix) with ESMTP for <gildas.avoine@uclouvain.be>;
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
(…)
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Hybrid encryption.
What does this mean?
One recipient. Several recipients.
Basics Public-Key Validity Key Distribution Key Revocation
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
PGP = Pretty Good Privacy Several flavors: PGP, PGPi, GPG. PGP.
Published by Philip Zimmermann in 1991. Portable software initially containing classical algorithms
MD5, IDEA, RSA.
First software allowing anybody to completely protect their
documents and messages.
3 years of enquiry and harassment by the American
government
Patented algorithms (RSA patented in the US until 2000). Suspicion of violating export regulations.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
1997:
Selling of PGP Inc. to McAffee (Network Associates).
Code no longer public
During the 39th IETF meeting at Munich, Zimmermann and
Callas requested the IETF to setup a working group on the standardization of PGP (OpenPGP [RFC1991, aug 96], [RFC2440, nov 98], [RFC4880, nov 07]).
Richard Stallman at the Individual-Network Betriebstagung at
Aachen requested the European hackers to implement public key softwares (US citizens were not allowed to do so outside us).
2001:
Zimmermann leaves Network Associates. Network Associates abandons PGP.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
2002:
PGP Corporation is created, buys back PGP rights. Code is again public. Free vs Trial download.
Basic functionalities remain available after 30 days. But not the additional functionalities eg disk encryption.
Complete system compliant with OpenPGP.
www.pgp.com Current version: 9.8
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
PGPi
Developed by Ståle S. Ytteborg
(Norway) to counter the US export regulations.
Maintained from 1997 to 2000. Obtained from the printed source
code of PGP.
MIT Press thus published a book
with the PGP source code.
www.pgpi.org
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
GPG
GPG = GnuPG = GNU Privacy Guard. GnuPG is the GNU GPL version of PGP. Initially, used Elgamal
and Blowfish instead of RSA and IDEA.
Follow the Open PGP Standard. Version 0.0.0 released on December 1997. Initially called G10. www.gnupg.org Current version: 2.0 GUI Frontends:
http://www.gnupg.org/related_software/frontends.en.html
Das Briefgeheimnis sowie das Post- und Fernmeldegeheimnis sind unverletzlich. Grundgesetz, Artikel 10, Abs 1. Secrecy of letters as well as sanctity of mail, telephone and telegraph are inviolable. Basic Law, Article 10, Paragraph 1
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Encryption / Signature. Key management.
What is called a PGP key is actually a PGP certificate. Web of trust.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
TDES [Mandatory]
IDEA
Still patented till 2010. Seem to be secure, resisted to all
cryptanalysis for 17 years…
CAST5 (128 bit-key) [should impl. CAST5]
Less studied than the other algorithms.
Blowfish (128 bit-key)
Less studied than the other algorithms.
Twofish (256 bit-key) (AES contest top-5 finalists)
Rather new.
AES (128/192/256 bit-key) [should impl. AES128]
THE standard since 2000.
A l l
t h e m s e e m t
e s e c u r e .
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Encryption
RSA Elgamal [Mandatory] (randomized encryption)
Signature RSA DSA [Mandatory] Elgamal no longer recommended for signature.
Attack by Phong Nguyen (2003) when Elgamal keys used
for both encryption and signature.
The flaw was exploitable during 4 years…
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
MD5
Deprecated.
SHA-1 [Mandatory]
Its use should be avoided.
SHA-224/256/384/512
Seem Ok.
RIPEMD-160
Seem Ok.
Tiger
Seem Ok.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
The private key cannot be memorized by the user. How can we protect our private key? It is stored on the hard disk.
Encrypted with from a password (no means to access it
without the user’s collaboration). The password is hashed to generate a symmetric key.
Once decrypted, it is in the computer’s memory (dangerous).
It may be stored on a smart card.
Access to the card is protected by a password. The key never leaves the card, it’s the data that transits
through the card to get encrypted, decrypted or signed.
The passphrase must be as strong as the key (i.e.,
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
How to be sure that the key we use to encrypt a
Directory.
Who did put the key into the directory?
Fake identity associated to the key?
Is the directory a legitimate one?
Face to face, check the ID, check the hash of the
Certificates.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Two important notions in PGP.
Validity: I know that this key belongs to Bob. Trust: I know that Bob does not sign keys arbitrarily.
When we sign a key, we declare its validity.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
We can also declare a full or partial trust. A key is valid if the sum of the partial trusts of its
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Several PGP key servers exist across the world.
http://pgp.mit.edu/
They contain all keys of all PGP users that want to
If Alice is sure that the key associated to Clara
If Eddy trusts Alice, he can accept Clara’s key.
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
How can we revoke a key published on a server? Servers are replicated: withdrawing a key is useless
How can we prove that we are allowed to revoke a key
We generate a key revocation certificate when we
We put a validity deadline to the key when we
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Which keys are involved when Alice sends an
Gildas Avoine - UCL Belgium - 2008 INGI2347 - Introduction
Symmetric-key crypto or public-key crypto. One Key / One service. Avoid to use the key directly.
Session Key (forward secrecy).
Key generation (Who, How eg issue in PRNGs). Key distribution. Identify the trusted parties. Revocation of the public-keys.
More generally, think about how to react to an attack.
Check the weak link (cf PGP).