1 / 72

Public Key Requirements

Public Key Requirements. computationally easy to create key pairs computationally easy for sender knowing public key to encrypt messages computationally easy for receiver knowing private key to decrypt ciphertext computationally infeasible for opponent to determine private key from public key

reid
Download Presentation

Public Key Requirements

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Public Key Requirements • computationally easy to create key pairs • computationally easy for sender knowing public key to encrypt messages • computationally easy for receiver knowing private key to decrypt ciphertext • computationally infeasible for opponent to determine private key from public key • computationally infeasible for opponent to otherwise recover original message • useful if either key can be used for each role

  2. Public Key Algorithms • RSA (Rivest, Shamir, Adleman) • developed in 1977 • only widely accepted public-key encryption alg • given tech advances need 1024+ bit keys • Diffie-Hellman key exchange algorithm • only allows exchange of a secret key • Digital Signature Standard (DSS) • provides only a digital signature function with SHA-1 • Elliptic curve cryptography (ECC) • new, security like RSA, but with much smaller keys

  3. The RSA Cipher Based on Number Theory and Modulu arithmetic Stallings App. A Prof. Ehud Gudes Security Ch3

  4. Fermat Little Theorem a is a relatively prime to P and P is Prime: ap-1 = 1 mod P orap = a mod P See proof p. 747 in [SB] Prof. Ehud Gudes Security Ch 4

  5. Euler Theorem Denote Ø(P) the number of numbers relatively prime to P and less than P( P is not necessarily prime) For P prime, clearly Ø(P) = P-1 For N=P*Q where both P and Q are primes, Ø(N ) = (P-1)* (Q-1) See proof in [SB] p. 748 Prof. Ehud Gudes Security Ch 4

  6. Euler Theorem (Cont.) if X is relatively prime to P, then XØ(P) = 1 mod P obvious if P is prime since Ø(P) = P-1 and use Femat little theorem For P not prime see proof in [SB] p. 749 Prof. Ehud Gudes Security Ch3

  7. RSA • פורסם ע”י Rivest, Shamirו-Adelmanב-78. • יהי N=PQ. • Pו-Q מספרים ראשוניים גדולים. • סדר החבורה הכפלית מודולו Nהוא (P-1)(Q-1) • החבורה הכפלית מודולו Nמכילה את כל המספרים בין 1 ל-Nשזרים ל-N. • לפי משפט אוילר a(P-1)(Q-1)=1 (mod N) Prof. Ehud Gudes Security Ch3

  8. RSA (cont.) • e הוא מפתח ההצפנה (הציבורי) • dהוא מפתח הפענוח (הפרטי). גם הפרוק של Nהוא חלק מהמפתח הפרטי. • הצפנה נעשית ע”י העלאת ההודעה בחזקת eמודולו N. • פענוח נעשה ע”י העלאת ה-ciphertextבחזקת dמודולו N. Prof. Ehud Gudes Security Ch3

  9. RSA (cont.) • מצא P ו-Q ראשוניים גדולים וחשב N=P*Q • מצא eו-dזרים ל-(P-1)(Q-1) שמקימים ed = 1 (mod (P-1)(Q-1)) C=Me (mod N) M=Cd(mod N) M=Cd(mod N) = Med(mod N) = M Note, to find d from e (e from d) one needs to know P and Q , i.e decompose N Prof. Ehud Gudes Security Ch3

  10. Proof of RSA ? Xed mod N = X ed = 1 mod (p-1) (q-1) ed = 1 + K.(p-1) (q-1) Xp-1 = 1 mod p (little Fermat) (Xk(q-1))(p-1) 1 mod p = rp + 1 (Xk(p-1))(q-1) 1 mod q = sq + 1 rp + 1 = sq + 1 = t . pq + 1 (since p and q primes)  1 mod pq X 1+k(p-1) (q-1) X *(1 mod pq) = X mod pq !! Prof. Ehud Gudes Security Ch 4

  11. RSA Algorithm

  12. RSA Example Example1: Let p=5 and q=7, whence n=pq=35 and Ø(n)=(5-1)(7-1)=24. Pick d=11. Then e=inv(11, 24)=11. Suppose M=2. C = M e mod n = 211 mod 35 = 2048 mod 35 = 18 and C dmod n = 1811 mod 35 = 2 = M Example2: Let p=53 and q=61, where n=53*61=3233 and Ø(n)=52*60=3120. Letting d=791, we get e=71. To encipher the message M=RENAISSANCE, we break it into blocks of 4 digits each, where A=00, B=01,…, Z=25, and blank=26 (in practice, characters would be represented by their 8-bit ASCII codes). We thus get M = R E N A I S S A N C E = 1704 1300 0818 1800 1302 0426 The first block is enciphered as 170471 Mod 3233 =3106. The entire message is enciphered as : C = 3106 0100 0931 2691 1984 2927 Prof. Ehud Gudes Security Ch 4

  13. RSA Example PU – is Public key PR – is Private key

  14. Computing Inverses 1. ax = 1 Mod P 2. ap-1 = 1 Mod P 3. X = ap-2 Mod P A more efficient algorithm by Knuth in [P] Prof. Ehud Gudes Security Ch3

  15. Computing Powers Example: 310 mod 5 (32 )5 mod 5 = (42 )* (42 )* 4 mod 5 = 4 very easy! – using associativity of MOD function Prof. Ehud Gudes Security Ch3

  16. Finding prime numbers Finding if a number is prime if N is represented by K bits 1. Simple: N/2 division O(2k) exp! 2. Use probabilistic algorithm: Rabin Test with m tries, you get prime with prob. 2-m for fixed m - 0(1) Ref: Corman et. al. 3. New!!!Deterministic Polynomial Alg.!!! Prof. Ehud Gudes Security Ch3

  17. Properties of RSA Cipher 1. Very secure! In order to find d from e or vice-versa, you need to know p and q. this means you need to find the two terms which divide n. This is called Factorization and it’s very difficult to factor huge numbers (500 bits!). 2. Method depends on finding large p and q prime! How this can be done? By using a probabilistic test, e.g. Rabin-Miller test. 3. A relatively slow cipher since arithmetic in modolu for large numbers is very slow! Prof. Ehud Gudes Security Ch3

  18. בטיחות RSA • בטיחותו של RSAמסתמכת על הקושי בפרוק מספר לגורמיו. • קיימת עבודת מחקר רבה בנושא של אלגוריתם לפרוק לגורמים. Prof. Ehud Gudes Security Ch 4

  19. פרוק לגורמים • RSA-129מספר בן 129 ספרות (426 סיביות), פורסם ב-1977. • פורק לגורמים ב-1994 ע”י שימוש ב-1600 מחשבים (דרך ה-Internet), תוך שמונה חודשים. • אלגוריתם הפירוק הטוב ביותר יכול לפרק מספר באורך 512 סיביות במספר חדשים תוך שימוש באלפי מחשבים • כיום לא ידוע על פרוק לגורמים של מספרים בני 768 סיביות או יותר Prof. Ehud Gudes Security Ch3

  20. Attacks on RSA • brute force • trying all possible private keys • use larger key, but then slower • mathematical attacks (factoring n) • see improving algorithms (QS, GNFS, SNFS) • See Table 20.2 in [SB] • currently 1024-2048-bit keys seem secure • timing attacks (on implementation) • use - constant time, random delays, blinding • chosen ciphertext attacks (on RSA props)

  21. Public Key Cryptography 2: El Gamal • Instead of using difficulty of factoring, we use difficulty of taking discrete logarithms. • Pick modulus, subgrp generator (g) - known. • Secret keys (s) are random numbers; public keys (p) is g to the s. • Encrypt message by picking blinding exponent (e), multiplying message by p^e. Also send g^e; recipient computes g^e^s (=p^e), and divides to recover message. • Bob (ge, M.Pe) Alice: (ge)s=pe; M= X/pe x Prof. Ehud Gudes Security Ch3

  22. ElGamal • מערכת הצפנה שמבוססת על בעיית ה-Discrete Log. • דורשת יצירה של מחרוזת אקראית בכל הצפנה. • אורך הטקסט המוצפן כפול מאורך הטקסט המקורי. • משמשת יותר לצורכי חתימה אלקטרונית Prof. Ehud Gudes Security Ch3

  23. Other Public-Key Algorithms • Digital Signature Standard (DSS) • FIPS PUB 186 from 1991, revised 1993 & 96 • uses SHA-1 in a new digital signature alg • cannot be used for encryption • elliptic curve cryptography (ECC) • equal security for smaller bit size than RSA • seen in standards such as IEEE P1363 • still very new, but promising • based on a mathematical construct known as the elliptic curve (difficult to explain)

  24. Elliptic curve cryptography • Because the RSA algorithm is rather inefficient in its use of key length, elliptic curve algorithms have been proposed (see [Sta99], Sect. 6.3). For example, exhaustive search of an elliptic curve algorithm with a key length of 150 bits takes 3.8 x 10 to the 10th MIPS-years, while the RSA with a key length of 512 takes only 3 x 10 to the 4th . • Because of their small memory requirements, elliptic curve algorithms are appealing for portable devices. Prof. Ehud Gudes Security Ch3

  25. Digital Signatures • Requirements:a) Authenticity – proves identity of Signer b)Un-forgeable – No other person can forge the signature (without knowing the key) c) No-repudiation - a signer cannot deny his/her signature 2. Symmetric key – cannot achieve C!use third party – inconvenient! Prof. Ehud Gudes Security Ch3

  26. Digital Signatures with Symmetric Key – Using an Arbiter Prof. Ehud Gudes Security Ch 4

  27. Digital signatures • PK algorithms have the property that the roles of the keys can be reversed; that is, D(E(M)) = E(D(M)) = M. This is the basis for digital signatures. • The transformations D and E are computationally easy but for any key K used for D and E it is unfeasible to find D from E or E from D. • 3 Prof. Ehud Gudes Security Ch 4

  28. אלגוריתמים לחתימה דיגיטלית I • אלגוריתמים לחתימה דיגיטלית הם אלגוריתמי מפתח ציבורי. • סימונים: • חתימה S • אימות חתימה V • חתימה על הודעה נעשית באמצעות מפתח החתימה הפרטי. SIG = D private key(M) • אימות החתימה נעשה ע”י מפתח האימות הציבורי. M = E public key (SIG) כל אחד שברשותו המפתח הציבורי יכול לאמת את החתימה. ? Prof. Ehud Gudes Security Ch 4

  29. אלגוריתמים לחתימה דיגיטלית II • ההודעה החתומה מיוצרת ע”י שרשור החתימה sigלהודעה M • אלגוריתמי חתימה דיגיטלית מספקים • Authentication, non-forgery • אימות זהותו של החותם על ההודעה • אי-יכולת לזייף חתימה • Integrity • הוכחה שההודעה לא שונתה • Non-repudiation • הגנה כנגד התכחשות של החותם להודעה. רק החותם יכול ליצר את החתימה, כי רק בבעלותו נמצא המפתח הפרטי Prof. Ehud Gudes Security Ch3

  30. אלגוריתמים לחתימה דיגיטלית III • ניתן להשתמש באלגוריתם הצפנה בעל מפתח ציבורי, בתור אלגוריתם חתימה דיגיטלית. • דוגמא : RSA. • חתימה - פענוח (בעזרת המפתח הפרטי) • אימות חתימה - הצפנה (בעזרת המפתח הציבורי) • לא כל אלגוריתם חתימה דיגיטלית יכול לשמש כאלגוריתם הצפנה. • דוגמא : DSA Prof. Ehud GudesSecurity Ch 4

  31. אלגוריתמים לחתימה דיגיטלית VI בעיות: • לא ניתן להבחין בין מקור ועותק של הודעה חתומה - יש להוסיף הגנה נגד replay • חתימה דיגיטלית ארוכה לפחות כמו ההודעה המקורית • ההודעה החתומה ארוכה לפחות פי שתיים מההודעה המקורית. • הפתרון: שימוש ב-HASHING Prof. Ehud Gudes Security Ch 4

  32. Hashing • Hashing is used for message authentication. A hash value is associated with a message, any change to the message will result in a change in the hash value and can be detected in this way. • Another application is the use of hash signatures for notarized documents. Prof. Ehud Gudes Security Ch 4

  33. One-way Hash Function A one-way hash function, like MD5 or HMAC-MD5, has the properties:one-way:given hash(S), it is hard to find Scollision-free:given S and hash(S), it is hard to find T such that S!=T and hash(S) = hash(T) Prof. Ehud Gudes Security Ch 4

  34. Secure Hash Functions

  35. Hash Function Requirements • applied to any size data • H produces a fixed-length output. • H(x) is relatively easy to compute for any given x • one-way property • computationally infeasible to find x such that H(x) = h • weak collision resistance • computationally infeasible to find y≠x such that H(y) = H(x) • strong collision resistance • computationally infeasible to find any pair (x, y) such that H(x) = H(y)

  36. תכונות של פונקציות Hash חד-כיווניות • פיזור הפלטים אחיד • הפלט של הפונקציה “נראה” אקראי • פרדוקס יום ההולדת • מה מספר האנשים שצריכים להיות בחדר בכדי שיהיה סיכוי גדול מ-1/2 שיש בחדר איש שיום ההולדת שלו נופל בתאריך זהה לשלי? - 183 • מה מספר האנשים שצריכים להיות בחדר בכדי שיהיה סיכוי גדול מ- 1/2, שיש ביניהם שניים שיום ההולדת שלהם באותו תאריך? – 23 ! Prof. Ehud Gudes Security Ch 4

  37. פונקציות Hashקריפטוגרפיות • פונקצית Hash - • הקלט הוא בעל אורך משתנה. • הפלט הוא בעל אורך קבוע (Digest) • (H(xקלה לחישוב • (H(xהיא One-way - בהינתן Digestקשה למצוא קלט שמיצר אותו • Collision Free - קשה למצוא שתי הודעות שמתמפות אל אותו Digest • דוגמאות : MD5, SHA-1, Tiger Prof. Ehud Gudes Security Ch 4

  38. חתימה דיגיטלית • (H(x - פונקצית Hashקריפטוגרפית • חתימה SIG = D private key(H(M)) • אימות החתימה H(M)=? E public key (SIG) Both parties know H! Prof. Ehud Gudes Security Ch 4

  39. Simple Hash Functions • a one-way or secure hash function used in message authentication, digital signatures • all hash functions process input a block at a time in an iterative fashion • one of simplest hash functions is the bit-by-bit exclusive-OR (XOR) of each block Ci = bi1bi2 . . . bim • effective data integrity check on random data • less effective on more predictable data • virtually useless for data security

  40. SHA Secure Hash Functions • SHA originally developed by NIST/NSA in 1993 • was revised in 1995 as SHA-1 • US standard for use with DSA signature scheme • standard is FIPS 180-1 1995, also Internet RFC3174 • produces 160-bit hash values • NIST issued revised FIPS 180-2 in 2002 • adds 3 additional versions of SHA • SHA-256, SHA-384, SHA-512 • with 256/384/512-bit hash values • same basic structure as SHA-1 but greater security • NIST intend to phase out SHA-1 use

  41. SHA-512 Structure (see [SB])

  42. Other Secure Hash Functions • most based on iterated hash function design • if compression function is collision resistant • so is resultant iterated hash function • MD5 (RFC1321) • was a widely used hash developed by Ron Rivest • produces 128-bit hash, now too small • also have cryptanalytic concerns • Whirlpool (NESSIE endorsed hash) • developed by Vincent Rijmen & Paulo Barreto • compression function is AES derived W block cipher • produces 512-bit hash

  43. Hashing and Electronic Cash – Shamir’s Method • Generate pairs (quadruples) of twins. • Verify by using the Hash function. • Very difficult to generate false coins • Easy to check repeating use by a Database Prof. Ehud Gudes Security Ch 4

  44. Blind Signatures Alice wants the Bank to sign on M without the Bank knowing MBank keys (e, d)Alice: x=M re mod n r-random;Bank: Xd=rMdAlice: Xd / r=Md!!M signed by Bank! Prof. Ehud Gudes Security Ch 4

  45. Digital Envelopes

  46. Message Authentication • protects against active attacks • verifies received message is authentic • contents unaltered • from authentic source • timely and in correct sequence • can use conventional encryption • only sender & receiver have key needed • or separate authentication mechanisms • append authentication tag to cleartext message

  47. Message Authentication Codes

  48. MAC תקן Message Authentication Codes MAC הוא קוד סימטרי (משמע מבוסס על מפתח סודי), שמספק Authentication Integrity אינו מספק Non-repudiation רק מקבל ההודעה שברשותו המפתח הסודי יכול לוודא את ה-MAC קיימים שלושה סוגים של MACs מבוססי פונקצית Hash. מבוססי צופן בלוקים. מבוססי Stream cipher Prof. Ehud Gudes Security Ch3

  49. Message Authentication

  50. MACs from Block Ciphers • הבלוק האחרון של הצפנה ב- CBC modeשל ההודעה משמש כ-MAC. • Integrity : שנוי סיבית בהודעה המוצפנת ישנה את הבלוק האחרון • Authenticity : מובטח ע”י מפתח ההצפנה הסודי Prof. Ehud Gudes Security Ch3

More Related