IELM 511: Information System Design: Part 1. ISD For Well Structured Data - Relational and Other DBMS
IELM 511: Information System Design: Part 1. ISD For Well Structured Data - Relational and Other DBMS
Introduction Part 1. ISD for well structured data relational and other DBMS Info storage (modeling, normalization) Info retrieval (Relational algebra, Calculus, SQL) DB integrated APIs Part 2. ISD for systems with non-uniformly structured data Basics of web-based IS (www, web2.0, ) Markups, HTML, XML Design tools for Info Sys: UML
Agenda
The mathematical basis for RSA encryption Modulo mathematics: +; *; ^ How RSA is implemented Proof of correctness of RSA Concluding remarks
Modulo mathematics
Given an integer m and positive integer n, m mod n is the smallest nonnegative integer r such that for some integer q m = nq + r Examples: 27 mod 3 = 0 [since 27 = 3*9 + 0] 27 mod 4 = 3 [since 27 = 4*6 + 3] -27 mod 4 = 1 [since -27 = 4+(-7)+ 1]
Modulo ring
Zn is the set of integers {0, 1, . . . , n 1} with two operators:
addition modulo n, denoted +n: multiplication modulo n, denoted: *n: i +n j = (i + j) mod n i *n j = (i * j) mod n
Exercises:
Prove that +n and *n satisfy the commutative property; Prove that *n distributes over +n
4 * 3 mod 12 = 0
Impossible to decrypt! Recipient gets message = 0; From the Z12 table, row a=4 there are four possible values.
5 * 7 mod 12 = 11
Only one entry = 11 in the Z12 table, row a=5
Recipient decrypts M = 7 !
Conclusion: This scheme works iff all entries in some row of Zn table are unique (and indeed, are a permutation of the set {0, 1, , n-1} Question: which combination of values n, a have this property ?
Examples:
2, 3, 5, 7 .. are prime numbers How many prime numbers are there? gcd( 12, 3) = 3 gcd( 12, 5) = 1 Given prime number p, what is gcd( p, n) = ?
Example: gcd( 235, 141) iteration 1: gcd( 235, 141): k = 235; j = 141; r = k mod j = 235 1 * 141 = 94 iteration 2: gcd( 141, 94): k = 141; j = 94; r = 141 - 1 * 94 = 47 iteration 3: gcd( 94, 47) : k = 94; j = 47; r = 94 2 * 47 = 0 iteration 4. gcd( 47, 0): returns 47.
Before studying the theory behind RSA, let's first see how RSA functions.
Notes: Large prime: a prime number with 150 digits or more (later we shall see why) Is T prime ? In step 3, e is selected so that e, T are relatively prime.
a-1
1 5 7 11
_______________
Correctness of RSA
1. Select two large prime numbers, p and q 2. Let n = pq; let T = ( p - 1)( q - 1) 3. Select a large prime, e (e != 1), such that gcd( e, T) = 1 4. Calculate d = e-1 mod T 5. The public key, Kp is (n ,e) 6. The secret key, Ks is d
Correctness of RSA
We first prove that for prime, p (or q), x mod p = xed mod p ed mod T = 1 there is some integer k such that ed = 1 + kT xed mod p = x1 + k(p-1)(q-1) mod p = x (xk(q-1))(p-1) mod p case 1. xk(q-1) is a multiple of p x is a multiple of p (since p is prime) xed mod p = 0 = x mod p case 2. xk(q-1) is not a multiple of p (xk(q-1))(p-1) = 1 (Fermat's little theorem) xed mod p = x * 1 mod p = x mod p xed mod p = x mod p (for prime numbers, p, q) xed x divides p (and q) xed x = ip = jq xed x is also divisible by pq [why?] xed x = k (pq) = k n for some integer k xed = kn + x. Therefore, for 0 x < n, xed = x
Security of RSA
To show that RSA is secure, we need some guarantee that 2.1. A party who knows n, e, and Me mod n, but not p, q, or d cannot compute M 2.2. A party who knows n (public key) cannot find its factors p, q (otherwise they could easily calculate d!) Given n, e, and Me mod n, Can we work backwards and compute M ? There is no known efficient algorithm to compute e-th root of a number mod n. [note: if n was always fixed, we could use a computer to build up a look-up decrypting sheet!] Given n (public key) can we find its factors p, q, and use them to compute T, and then use e to compute d ? So far, there is no known efficient algorithm to factorize a number.
Discussion
RSA is currently the basis for almost all secure eCommerce Examples: banks (e.g. try hsbc.com, standardchartered.com.hk, ) signed emails (e.g. HKUST's ITSC) Once RSA has established a secure communication channel, two way symmetric encryption is used, usually some variant of DES, which is a block cipher algorithm.
Three important mathematicians whose works were used in this lecture: Euclid (300 BC ) Fermat (17th century) Euler (18th century)
Simon Singh, The Code Book, pub. Anchor press, 2000 PDF article giving brief introduction to RSA maths (Utah State, Prof Moon) Wikipedia cryptography portal Prof Deng Xiaotie/Prof Frances Yaos lecture notes (City Univ, HK)