Message Authentication 8
Message Authentication Message authentication is concerned with: protecting the integrity of a message, i.e. alteration of message is detectable validating identity of originator, i.e. by requiring common key between sender and receiver (Timely and correct sequence of message) Functions for message authentication: Message authentication code (MAC) Hash function 9
Message Authentication Code (MAC) MAC function: Creates a small fixed-sized block (MAC) as a checksum MAC depends on message M and a key K MAC = F mac (M, K) efficient to compute Is a many-to-one function (therefore usually not reversible) potentially many messages have same MAC finding the message that maps to the same MAC is difficult Properties: Receiver can performs same computation on message to check if it matches the MAC Provides assurance that message is unaltered If message M is altered, then F mac (M, K) MAC with high probability, where M is altered message Assures that Message comes from sender, if only sender and receiver knows K 10
Message Authentication Code (MAC) Alice and Bob share key K AB Alice sends authenticated message M to Bob: Generate MAC = F MAC (K AB, M) Append message M to MAC and send M MAC to Bob Bob verifies authenticity of M Verifies MAC F MAC (K AB, M) If equal, then with high probability M was not modified Alice is sender of M Otherwise M was modified 11
Message Authentication (Hash) Hash function H: Maps arbitrary message to fixed size hash value (fingerprint) h = H(M), easy to compute for any message M hash function H is public (i.e. known to everyone) In contrast to MAC no key is used in H, i.e. no authentication if H is used alone Properties One-way function: given h it is infeasible to find x s.t. H(x) = h Weak collision resistance: given x it is infeasible to find y s.t. H(y) = H(x) Strong collision resistance: it is infeasible to find any x, y s.t. H(y) = H(x) 12
Message Authentication (Hash) Using hash for message authentication: a) Encrypt hash with symmetric key K shared between sender and receiver M, E(K, H(M)) b) Sign hash with private key PR a of receiver M, E(PR a, H(M)) c) Hash (key message) to avoid expensive encryption M, H(S M) 13
Message Authentication (Hash) Strength of hash function: Weak collision resistance (2 n ) Strong collision resistance (2 n/2 ) (see Birthday problem: probability that in a set of randomly chosen people some pair of them will have the same birthday) Attacks Cryptanalysis: exploit logical weakness in algorithm Brute-force attack Example of hash functions: SHA most widely used hash algorithm SHA-1 gives 160-bit hash more recent SHA-256, SHA-384, SHA-512 provide improved size and security Others: e.g. MD5 14
Digital Signatures and Certificates 15
Vertragsabwicklung Allgemein Vertrag (Kontrakt), mehrseitiges Rechtsgeschäft zur Begründung, Aufhebung oder Änderung eines Rechtsverhältnisses, das durch übereinstimmende Willenserklärungen (Schriftform), nämlich Antrag und Annahme, zwischen zwei oder mehreren Personen zustande kommt. Das Zustandekommen eines wirksamen Vertrages kann von der Einhaltung einer bestimmten Form, der Zustimmung dritter Personen oder einer Behörde, der (konstitutiven) Eintragung in ein Register (z.b. Grundbuch) oder dem Eintritt einer Bedingung abhängig sein. (c) Meyers Lexikonverlag Siegen, 3 Nov. 2009 Kaufvertrag Zwischen Dr. Rolf Schäfer aus Bonn und Dr. Holger Burckhart aus Saarbrücken wird folgender Vertrag geschlossen: Villa La Rotonda des Herrn Dr. Schäfer geht für 20 000 000 Euro in das Eigentum von Herrn Dr. Burckhart über. Schäfer Dr. R. Schäfer Glaubicht Burckhart Dr. H. Burckhart B. Notar 16
Authentizität und Integrität von wesentlicher Bedeutung: Die Identitäten Dr. R. Schaefer, Dr. H. Prof. Dr. Holger Burckhart etc. mit Ortsangaben Die Unterschriften und das Siegel Als Inhalt den Vertragsgegenstand Verkauf der Villa La Rotonda, den Verkaufspreis sowie Vertragsort und -datum Unterschreiben: Die angegebene Identität wird durch die Unterschrift authentisch Der Signierende muss durch eine Aktion (die Unterschriftbildung) seinen Willen bekräftigen Der Signierende bestätigt durch seine Unterschrift objektiv den Gegenstand dessen, was unterschrieben werden soll, und zwar durch die Position, an der die Unterschrift angebracht wird Der Signierende bestätigt durch seine Unterschrift subjektiv (also durch seine Interpretation des Inhaltes) die Integrität dessen, was er unterschreibt 17
Prüfen Die beteiligten Identitäten können erkannt werden Die Unterschrift kann auf Echtheit und damit die Authentizität überprüft werden da die Unterschrift individuell ist Die vom Signierer geleistete Unterschrift kann nicht geleugnet werden da die Unterschrift individuell ist Der Inhalt kann auf Integrität (z. B. nachträgliche Änderungen) überprüft werden Es kann festgestellt werden, ob das Originaldokument oder eine Kopie vorliegt Ist dies in der digitalen Welt möglich? 18
Digital Signature Signer Alice: Public/private key: PU a, PR a Signed message: Sign M = ( M, E(PR a, H(M) ) = ( M, Sign HM ) Verifier Bob: Verifies: H(M) D(PU a, Sign HM ) Digital Signature with RSA: Alice: Sign HM = H(M) PR a mod n, sends Sign M = (M, Sign HM ) Bob: H(M) (Sign HM ) PU a mod n 19
Public Key Certificates Information: UID: User s ID UPK: User s public key Cinf: Certification authroity (CA) ID, time of validity of certificate Certificate: ((UID UPK Cinf), E(PR CA, H(UID UPK Cinf))) 20
Key Exchange 21
Diffie-Hellman Key Exchange First public-key type scheme proposed by Diffie & Hellman in 1976 along with the exposition of public key concepts note: now know that Williamson (UK CESG) secretly proposed the concept in 1970 practical method to exchange a secret key used in a number of commercial products security relies on difficulty of computing discrete logarithms If q prime number, α a generator of Z p * α x = h mod q x is known as discrete logarithms of h to basis α modulo q: x = log α (h) mod q discrete logarithm assumption 22
Diffie-Hellman Key Exchange Exchange of common key in a hostile environment Common input: Prime number q Generator α of Z q * (also called primitive root of Z q *), i.e. {α 0, α 1,.., α q-1 } are all numbers of Z q * 1. Choose X A Z q * send Y A = α X A mod q 3. Common secret key: K = Y B X A = α X B X A mod q Y A Y B 2. Choose X B Z q * send Y B = α X B mod q Common secret key: K = Y A X B = α X A X B mod q Note Attacker can see: q, α, Y A, and Y B Security of secret key K is based on difficulty of computing discrete logarithm in Z q *, i.e. to obtain K, attack must solve X B = log α (Y B ) 23
Diffie-Hellman Example Common input: prime number q = 353 primitive root α = 3 A and B each compute their public keys A: X A =97, sends Y A = 3 97 mod 353 = 40 B: X B =233, sends Y B = 3 233 mod 353 = 248 Exchange and compute common secret key: A: K = (Y B ) X A mod 353 = 248 97 mod 353 = 160 B: K = (Y A ) X B mod 353 = 40 233 mod 353 = 160 Obtaining common secret key by attack: Solve 3 a mod 353 = 40=X A (no efficiently algorithm known) Desired answer is 97, then compute key as B does 24
Diffie-Hellman: Man-in-the-Middle Attack Attacker Darth: 1. Darth: generates private key X D, and public key Y D, i.e. Y D = α X D mod q 2. Alice: transmits Y A to Bob 3. Darth: intercepts Y A and transmits Y D to Bob instead 4. Bob: receives Y D and calculates K 1 (believed to be secret key with Alice) 5. Bob: transmits Y B to Alice 6. Darth: intercepts Y B and transmits Y D to Alice. Can calculate K 1, K 2 7. Alice: receives Y D and calculates K 2 (believed to be secret key with Bob) all subsequent communications compromised 1. Choose X A Z q * send Y A = α X A mod q Y A Y D 2. Choose X B Z q * send Y B = α X B mod q 3. Common secret key: K 2 = Y D X A = α X D X A mod q Y D Y B Common secret key: K 1 = Y D X B = α X D X B mod q K 1, K 2 25
FIN FIN 26