1 / 26

Elements of Coding and Encryption

Elements of Coding and Encryption. Continuation. Greatest Common Divisor. Given integers m and n , not both zero, we define the greatest common divisor of m and n to be the largest integer that divides both m and n : GCD ( m , n ).

lotta
Download Presentation

Elements of Coding and Encryption

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. Elements of Coding and Encryption Continuation

  2. Greatest Common Divisor • Given integers m and n, not both zero, we define the greatest common divisor of m and n to be the largest integer that divides both m and n: GCD(m, n). • Note that if m≠ 0, then GCD(m, 0) = |m|.

  3. Greatest Common Divisor: Euclidian Algorithm • Determine the greatest common divisor (GCD) for two numbers. • Euclidean algorithm: GCD (a,b) can be recursively found from the formula • Theorem. Let a, b, c, and q be integers with b>0. If a=qb+c, then GCD(a, b) = GCD (b, c).

  4. Euclidean Algorithm.Example GCD(22,77):

  5. Euclidean Algorithm.Example GCD(22,77):

  6. Euclidean Algorithm.Example GCD(22,77):

  7. Euclidean Algorithm.Example GCD(22,77):

  8. Simple Encryption • Variations on the following have been used to encrypt messages for thousands of years. • Convert a message to capitals. • Encode each letter by a number between 1 and 26. • Apply an invertible modular function to each number. • Convert back to letters (0 becomes 26).

  9. Letter  Number Conversion Table

  10. Encryption example • Let the encryption function (“secret key”) be f (a) = (3a + 9) mod26 • Encrypt “Stop Thief” • STOP THIEF (capitals) • 19,20,15,16 20,8,9,5,6 • 14,17,2,5 17,7,10,24,1 • Scipher obtained: NQBE QGJXA

  11. Decryption example • Decryption works the same, except that we apply the inverse key function. • Find the inverse of f (a) = (3a + 9) mod26 • If we didn’t have to deal with mod 26, inverse would be g (b) = 3-1 (b- 9) • We’ll see that since GCD(3,26) = 1, the inverse of 3 (mod 26) is the number 9. This gives: g (b)= 9(b- 9) mod 26 = (9b – 3) mod 26

  12. Open key Encryption • Encryption methods, which are based on the “secret key” function have one, but significant disadvantage: it is necessary to distribute a key among all users and all of them must take care of keeping the key unavailable to others. • The alternative is an “open key” encryption, which became very popular during last 15-20 years. In this method, which is based on the modular arithmetic, two different keys are used for encryption and decryption. The encrypting key is a “public key”, it is open, while the decrypting key is hidden.

  13. RSA Encryption • In “open key” encryption methods, it is extremely hard (actually, it is impossible within some reasonable long time interval) to reverse a key, which is used for the encryption. • One of the most popular, efficient (and simple!) modern “open key” encryption methods is RSA named for its inventors (Rivest, Shamir, Adleman).

  14. Modular Exponentiation • Modular exponentiation is a key operation in the RSA encryption. It is raising of a number to a power e in Zn: • In the RSA method, both e and n are very large numbers. In the real world applications, n is an integer of about 400 decimal digits.

  15. Modular Exponentiation • To perform modular exponentiation, congruence properties are used. • To reduce computations, exponent e should be presented as a sum of powers of 2 (any integer number should be easily presented in such a way: ) • Then the following technique should be applied:

  16. Modular Exponentiation • For example, let • Then

  17. RSA Encryption • In the RSA encryption method, a message is converted into numbers, as in the modular encryption that we saw before. • The letters are then put together into number blocks with each block less than n. • Then each number block is exponentiated by the exponent e modulo n , which completes the encryption procedure.

  18. RSA Encryption • In the RSAencryption method, n is chosen to be the product of prime numbers. • If n=pq, then e is chosen so that GCD (e, r) = 1, where r= (p-1)(q-1). There are many such es (almost all positive integers satisfy the given condition). • In the RSAdecryption, the exponent d is chosen as the smallest positive solution x to the congruence ex1 (mod r): (be(modn))d(modn)= b

  19. RSA Encryption  b e(mod n) n = 4559, e = 13. Smiley Transmits: “Last name Smiley”

  20. RSA Encryption  b e(mod n) n = 4559, e = 13. Smiley Transmits: “Last name Smiley” • L A S T N A M E S M I L E Y

  21. RSA Encryption  b e(mod n) n = 4559, e = 13. Smiley Transmits: “Last name Smiley” • L A S T N A M E S M I L E Y • 1201 1920 0014 0113 0500 1913 0912 0525

  22. RSA Encryption  b e(mod n) n = 4559, e = 13. Smiley Transmits: “Last name Smiley” • L A S T N A M E S M I L E Y • 1201 1920 0014 0113 0500 1913 0912 0525 • 120113mod 4559, 192013mod 4559, …

  23. RSA Encryption  b e(mod n) n = 4559, e = 13. Smiley Transmits: “Last name Smiley” • L A S T N A M E S M I L E Y • 1201 1920 0014 0113 0500 1913 0912 0525 • 120113mod 4559, 192013mod 4559, … • 2853 0116 1478 2150 3906 4256 1445 2462

  24. RSA Encryption  b e(mod n) n = 4559, e = 13. Smiley Transmits: “Last name Smiley” • L A S T N A M E S M I L E Y • 1201 1920 0014 0113 0500 1913 0912 0525 • 120113mod 4559, 192013mod 4559, … • 2853 0116 1478 2150 3906 4256 1445 2462

  25. RSA Encryption • a private decryption exponent d ,which when applied to n , recovers the original blocks b : (b emod n )dmod n = b • For n = 4559, e = 13 the decryptor d= 3397

  26. Homework • Read Sections 3.2 – 3.3 • Problems (Exercises 3.3) 1, 2.

More Related