This action might not be possible to undo. Are you sure you want to continue?

`

`

**Three Basic Issues associated with data transmission Data Compression Problem
**

Can the data be compressed in some form apart from the original such that the number of bits sent is minimum, but no information is loss?

`

**Data Compression Problem
**

Huffman- Coding technique in your book uses a greedy method to solve this problem. Know the probability of occurrence of each character that could appear. Represent the most frequently occurring characters by a shorter number of bits than the number of bits of the least frequently occurring characters

` Data Compression Problem Lempel-Ziv (LZ) techniques are widely used as basis for such algorithms .

Can transmission errors be detected and if possibly be corrected? See following link for more details http://en.` ` ` ` ` Transmission of data can be subject to errors Bits can be lost.org/wiki/Error_correction .wikipedia.

` ` Can transmission data be made secure from unauthorized spying and /or tampering? Through out history of there have been many techniques (algorithms) to solve this problem .

` Recent algorithms Diffie-Hellman Algorithm x First public key. private algorithm x Based on the difficulty of factoring logarithms Merkle-Hellman Algorithm x Based on the non-fractional knapsack problem x Non-fractional knapsack problem difficult to solve x Is NP-complete x Intruder would have to solve the non-fractional problem for large number of items .

The security of the scheme depends on not being able to factor the product of large primes quickly . Adelman (RSA) Algorithm RSA scheme based on the inability to factor large prime numbers Scheme depends initially finding them quickly .` ` The Rivest. Shamir.

` ` RSA scheme developed from concepts in number theory Review of number theory follows later .

the number of bits to represent that input .` ` Large inputs here mean inputs that are ³large integers´ rather than a large amount of many integers Size of an input is measured in ³number of bits´.

....... if it runs time polynomial in lg a1.. lg a2.....` An algorithm with inputs a1. a2. log an The ³number of bits´ in an integer an is «lg an 1» .an runs in polynomial in time .

division or remainder at this point thought to take one unit of time to estimate the running time of an algorithm. multiplication. Counting the number of these operations when an algorithm gives an estimate of the running time of the algorithm .` ` Addition.

` In a number theoretic algorithm. it is useful to consider the number of bit operations done by the algorithm to estimate running time. .

5 F Similarly dividing an bit integer by a shorter F integer or taking the remainder by dividing by a shorter integer both take ( 2) Faster methods to do multiplication and division are known 5 F .` ` ` Multiplication of two bit integers by ordinary F operations takes ( 2 ) .

... 2.} is the set of all integers The set N = {0. 1.-2.. -1...` ` ` Review of elementary number theory Z = {... 2. 1..} is the set of all natural numbers . 0.....

If d | a . can¶t write 18 = k*5 . we write d | a 5 | 18. we can say that a is a multiple of d If d does not divide d. since 20 = 4* 5.` ` ` Divisibility and divisors of integers d | a means ³d divides a´ d | a ( ³d divides a´) means a = k d for some integer k. 5 | 20 ( 5 divides 20). where k =4 ` ` ` Every integer divides 0.

then 48 is a multiple of 12 48 = 4*12 . if d | a If 12 | 48.` a is a multiple of d.

means ³d is a divisor of a´ Divisors of 24 = {1. 24} ` ` ` ` d | a iff -d | a A divisor of an integer a is at least 1 but not greater than |a| Every integer a is divisible by 1 and a.` If d | a and d >= 0. 2. 4. 3. 6. its trivial divisors Non trivial divisors of integer a are called factors of integer a . 12. 8.

11. 31. 47. 53. 5. 71} . 3. 19.` An integer a > 1 whose only divisors are only 1 and a are called prime integers First 20 primes are = { 2. 29. 7. 59. 17. 13. 43. 61. 41. 23. 67. 37.

0 and negative integers are neither prime or composite .` An integer a > 1 not prime is called a composite integer 39 is a composite number since 39 = 3*13 ` ` The integer 1 is neither prime or composite and is called unit Similarly.

there exist unique integers q and r. that the remainder is 0 . 0<=r < n. and positive integer n. and a = q*n + r composite integer q= a / n ½ the quotient is r is the remainder n | a iff a mod n =0 .` For any integer a.

... [ 3]7 = { . 3 + (-1)(7) = -4. 3 + 1*7=10 «} The set of all equivalence classes for n is Zn = { n } ?aA k= -1 k= -2 ...` ` ` ` The integers can be divided into n equivalent class Z] ?aAn = [ a+ kn: k For example..3 + 0*7=3.. 3 + (-2)(7) = 3 -14 = 11.

8. 6.15} Divisors of 24 are { 1. 2. 3 divides each term in sum This result is used in the Extended-Euclid GCDAlgorithm discussed below. 5. 12} Common divisors of 30 and 24 are {1. 3. 2. 6} If d | a and d | b. . 2. 3. then d is a common divisor of a.10. then d |(ax + by) for any integers x and y 3 | 30 and 3 | 24 implies 3 | (30(-4) + 24(-5)).` ` ` ` ` If d | a and d | b. 3. Divisors of 30 are { 1. 6. 4.

4. 5. 2.30)= 6 . 6} The gcd(24.b). 12} Common divisors of 30 and 24 are {1. 2. are the largest common divisors of a and b Denote as gcd(a. 6. 6. 3. both not zero. 3.` ` ` ` ` ` The greatest common divisor of integers a and b. Divisors of 30 are { 1. 2.10.15} Divisors of 24 are { 1. 3. 8.

4} Divisors of 15 are { 1.` ` ` ` Two integers a and b are relatively prime. 5} . 2. 8 and 15 are relatively prime Divisors of 8 are { 1. 3. if there only common divisors is 1.

` ` ` ` ` For all primes p and all integer pairs a and b. Let p=5. then p | 15 A composite integer a can be written in exactly one way as a product primes. 6000 = 24 * 31 * 53 . if p|ab then p|a or p|b or both Consider a=8 and b=15. p | 8*15 p | 120. For example.

i 1 while(a > 1) do while (a % pi = 0) do print pi a= a/ pi i i+1 .Given a positive integer a and a list of all primes {pi }.

List of primes {pi } ={2.««}.Let a = 12. 5. i 1 while(a > 1) do while (a % pi = 0) (12%2)=0 true do print pi print 2 a= a/ pi a=12/2=6 i i+1 . 3.

5.««}. i 1 while(a > 1) do while (a % pi = 0) (6%2)=0 true do print pi print 2 a= a/ pi a=6/2=3 i i+1 . 3. List of primes {pi } ={2.Let a = 12.

Let a = 12. i 1 while(a > 1) do while (a % pi = 0) (3%2)=0 false do print pi a= a/ pi i i+1 i = 1 + 1=2 . 5.««}. 3. List of primes {pi } ={2.

3. 5.««}.Let a = 12. List of primes {pi } ={2. i 1 while(a > 1) 3 > 1 true do while (a % pi = 0) (3%3)=0 true do print pi print 3 a= a/ pi a=3/3=1 i i+1 .

List of primes {pi } ={2.Let a = 12. i 1 while(a > 1) 3 > 1 true do while (a % pi = 0) (1%3)=0 false do print pi a= a/ pi i i+1 i = 2 +1 =3 . 5. 3.««}.

Let a = 12.««}. 5. 3. List of primes {pi } ={2. i 1 while(a > 1) 1 > 1 false DONE do while (a % pi = 0) do print pi a= a/ pi i i+1 .

b) and gcd(b.9) Factorization of 24 = 23 * 3 Factorization of 15 = 3 * 5 Factorization of 9 = 32.b) The gcd(a. a mod b) both divide each other and thus are equal Example gcd(24. . ` Euclid¶s Basic Algorithm to find the gcd(a.15) and gcd(15.

a recursive algorithm can be written to solve gcd(a.` Since gcd(a.b) and gcd(b.b) . a mod b) are equal .

so d | gcd(b. Show that gcd(a.` ` ` Show that gcd(a. a mod b). It follows that d | a mod b.b) = gcd(b. But d | b. Let d = gcd(a.b) | gcd(b.It follows that d | a and d | b.b).½ a mod b is a a mod b = a ± qb where q = linear combination of a and b. a mod b). mod a)(MORE) . / b.

.b) .` Show that gcd(b. a mod b) = gcd(a.

9) = gcd(9.15) = gcd(15.0)= a which is the stop rule For the algorithm .3 ) = gcd (3.gcd(24. 6) = gcd(6.0) = 3 Note that answer occurs when gcd(a.

a mod b) .Euclid(a.b) 1 if b= 0 2 then return a 3 else Euclid(b.

b). then the coefficients x and y are important x and y are useful in computing multiplicative inverses. Public and private keys in RSA are multiplicative inverses of each other .` ` ` From above we know that if d | a and d| b. then d | (ax + by) for some integers x and y When d is the gcd(a.

b) = a*x + b*y . x.b) .b) = a*x + b*y ` Extended-Euclid takes an input pair a and b and returns a triple of the form: ( d.` Re-write Euclid Algorithm to compute x and y such that gcd(a. y ) that satisfies gcd(a. d = gcd(a.

Extended-Euclid(a, b) 1 if b = 0 2 then return (a, 1, 0)

3 (d µ, x¶, y¶ ) = Extended-Euclid( b, a mod b) 4 (d, x, y ) = (d¶, y¶, x¶ - a / b½ 5 return (d, x, y) y¶ )

Extended-Euclid(99, 78) 1 if b = 0 2 then return (a, 1, 0) 3 (d µ, x¶, y¶ ) = Extended-Euclid( 78, 21) 4 (d, x, y ) = (d¶, y¶, x¶ - a / b ½ y¶ ) 5 return (d, x, y) Extended-Euclid(78, 21) 1 if b = 0 2 then return (a, 1, 0) 3 (d µ, x¶, y¶ ) = Extended-Euclid( 21, 15) 4 (d, x, y ) = (d¶, y¶, x¶ - a / b ½ y¶ ) 5 return (d, x, y) Extended-Euclid(21, 15) 1 if b = 0 2 then return (a, 1, 0) 3 (d µ, x¶, y¶ ) = Extended-Euclid( 15, 6) 4 (d, x, y ) = (d¶, y¶, x¶ - a / b½ y¶ ) 5 return (d, x, y)

Extended-Euclid(15, 6) 1 if b = 0 2 then return (a, 1, 0) 3 (d µ, x¶, y¶ ) = Extended-Euclid( 6, 3) 4 (d, x, y ) = (d¶, y¶, x¶ - a / b ½ y¶ ) 5 return (d, x, y) Extended-Euclid(6, 3) 1 if b = 0 2 then return (a, 1, 0) 3 (d µ, x¶, y¶ ) = Extended-Euclid( 3, 0) 4 (d, x, y ) = (d¶, y¶, x¶ - a / b ½ y¶ ) 5 return (d, x, y) Extended-Euclid(3, 0) 1 if b = 0 2 then return (3, 1, 0) 3 (d µ, x¶, y¶ ) = Extended-Euclid( 15, 6) 4 (d, x, y ) = (d¶, y¶, x¶ - a / b½ y¶ ) 5 return (d, x, y) Is true

` return of (3. 0) leads to a pop off the call stack . 1.

y ) = (d¶.x¶=1.a / b ½ y¶ ) 5 return (d. 0) 3 (d µ. 3) 4 (d. x. 0. 1 .y¶=0) 4 (d. 3) 1 if b = 0 2 then return (a. 0.a / b½ y¶ ) (d=3 . 6) 1 if b = 0 2 then return (a. 1. x. x. y¶. x¶ . x =0 . 1) . 0) 3 (d µ. 1. y¶. y ) = (d¶.6 3½ *0) 5 return (3.Extended-Euclid(15. x¶. 1 . y= 1 ) = ( 3. y¶ ) = Extended-Euclid( 3. y¶ ) = Extended-Euclid( 6. y) Extended-Euclid(6. x¶. 0) ( d¶=3.

0. 1) leads to a pop off the call stack .` return (3.

Extended-Euclid(15. x =1 . 1. 0 . 6) 1 if b = 0 2 then return (a.15 6½ *1) (d=3 . y= -2 ) = ( 3. 0. y¶. x¶. y= 1 ) = ( 3. y ) = (d¶. 0. x. 0 5 return (3. 3) ( d¶=3.a / b½ y¶ ) (d=3 . 1. x¶ . y¶ ) = Extended-Euclid( 6.x¶=0. 0) 3 (d µ.y¶=1) 4 (d. x =1 . -2) 2 *1) .

` return (3. -2) leads to a pop off the call stack . 1.

y¶. x¶ . y¶. 15) 1 if b = 0 2 then return (a. x¶= 1. y) Extended-Euclid(21. y¶= -2) 4 (d. 1.a / b ½ y¶ ) 5 return (d. x¶. 0) 3 (d µ. 78) 1 if b = 0 2 then return (a. y ) = (d¶. -2.Extended-Euclid(99. 21) 4 (d. y¶. y ) = (d¶. 6) (d¶= 3. 15) 4 (d. y¶ ) = Extended-Euclid( 78. y) Extended-Euclid(78. y¶ ) = Extended-Euclid( 15. 1. 1 . y¶ ) = Extended-Euclid( 21. 0) 3 (d µ. y ) = (d¶. x. x. 0) 3 (d µ.21 / 15½ (. x¶ . x¶. 3) . -2. x¶. -2. x. 1.a / b½ y¶ ) (3. 21) 1 if b = 0 2 then return (a. 3 ) = ( 3.a / b ½ 21 / 15½ y¶ ) 5 return (d. x. x. x¶ .2) 5 return (3.

3) leads to a pop off the call stack .` return (3. -2.

78 21½ 3) (3. y¶ ) = Extended-Euclid( 78. x¶ . 3. 78) 1 if b = 0 2 then return (a. x¶. x. x¶. x. _ ) = ( 3. 3. -11 ) = ( 3. y) Extended-Euclid(78. 15) ( d¶= 3. y¶. x. y¶= 3 ) a / b ½ 4 (d. 1. y¶.3* 3) 5 return (3. x¶ = -2. -11) .a / b½ y¶ ) 5 return (d. -2 . 3. x¶ - y¶ ) (3. -2 . 1. 3. 21) 4 (d. 0) 3 (d µ. 3. y ) = (d¶.Extended-Euclid(99. y ) = (d¶. y¶ ) = Extended-Euclid( 21. 0) 3 (d µ. 21) 1 if b = 0 2 then return (a.

3. -11) leads to a pop off the call stack .` return (3.

-11. x¶ . 1. x. -11. 3 - 99 78½ (-11) ) (3. -11. y¶= -11 ) 4 (d. y ) = (d¶. _ ) = ( 3.1*(-11) ) 5 5 return (3. 21) ( d¶= 3.Extended-Euclid(99. 78) 1 if b = 0 2 then return (a. 3 . -11. y¶.a / b ½ y¶ ) (3. -14 ) = ( 3. x¶. 0) 3 (d µ. -11. 14 ) . y¶ ) = Extended-Euclid( 78. x¶ = 3.

x= -11.78) = (d= 3.` ` ` return (3. -14) leads to a pop off the call stack No more calls on call stack Extended-Euclid(99. y = -14) ` ` The equation d = ax + by holds 3 = 99(-11) + 78(-14) . -11.

` ` Download following spreadsheet for Extended_Euclid Calculator ExtendedEuclid.xlsx .

floor(a/b) y¶ = 3 = 1 ± 1 *(-2) = 1 ±(-2)=3 . 0) Line 4: y = x¶ .a 99 78 21 15 6 3 b floor(a/b) d x y d=ax + by 78 1 3 -11 14 3 21 3 3 3 -11 15 1 3 -2 3 Line 4 6 2 3 1 -2 3 2 3 0 1 0 3 1 0 b = 0 return(a 1.

n-1} All operations done modulo n If n= 6. 2...` ` ` Arithmetic over the integers where every result is in the set of integers {0. (5 + 4) mod 6 = 3 .. 1..

` A group is a set S along with a binary operation along with the following properties: Closure: x the result of all operations with are in the set S a = a Identity: x There exist an element e in the group such e or a e a for all a¶s in the set S = Associativity: x For any a. c in S (a c ( b) = a b c) . b.

called an inverse.` A group is a set S along with a binary operation along with the properties: Inverses x For each a in the set S there exist a unique element b in the set. such that a = b b a =e .

Consider the set of integers Zn for some integer n Retain ordinary operation of addition and multiplication except use mod operator a + b means (a +b) (mod n) ab means (ab) (mod n) ` Define the additive group (Zn . +n ) The size of the group is n Consider (Z6 . See table in next slide . +6 ).` ` ` An addition group.

(1 + 5) mod 6 = 0 2-1 = 4. (0 + 0 ) mod 6 = 0 1-1 = 5. . ( 3 + 3) mod 6 =0 4-1 = 2. 5-1 = 1.+6 0 1 2 3 4 5 0 0 1 2 3 4 5 1 1 2 3 4 5 0 2 2 3 4 5 0 1 3 3 4 5 0 1 2 4 4 5 0 1 2 3 5 5 0 1 2 3 4 0 is the identity element: 2 +6 0 = ( 2 + 0 ) mod 6 = 2 Inverses: 0-1 = 0. ( 2 + 4) mod 6= 0 3-1 = 3 .

[4]6 ={«4+(-1)*6. [a] n * [b] n = [ a * b] n. 2 + 0*6.2+2*6«} Use the least non-negative integer to represent the class . 4+1*6. 2+1*6.` ` ` ` ` ` [a]n = {a + kn: k Z} [a]n + [b] n = [ a + b] n. 4 + 0*6.4+2*6«} [2]6 ={«2+(-1)*6.

2.14«} Use the least non-negative integer to represent the class 4 represents equivalence class [4]6 2 represents equivalence class [2]6 . 4 .` ` ` [4]6 ={«-2. 8. 10.16«} [2]6 ={«-4.

6+1*6. 0.6+2*6«} [6]6 ={«-6.18«} 0 represents equivalence class [6]6 ` See full (Z+6 . 12.+6 ) next 10 can represents equivalence class [4]6 8 can represent equivalence class [2]6 ` (10+8) mod 6 = 0 .. 6+0*6.` ` ` [4]6 + [2]6 =[4+2]6 = [6]6 [6]6 ={«6 + (-1)*6. 6.

. ( 2 + 4) mod 6= 0 3-1 = 3 .+6 0 1 2 3 4 5 0 0 1 2 3 4 5 1 1 2 3 4 5 0 2 2 3 4 5 0 1 3 3 4 5 0 1 2 4 4 5 0 1 2 3 5 5 0 1 2 3 4 0 is the identity element: 2 +6 0 = ( 2 + 0 ) mod 6 = 2 Inverses: 0-1 = 0. ( 3 + 3) mod 6 =0 4-1 = 2. 5-1 = 1. (0 + 0 ) mod 6 = 0 1-1 = 5. (1 + 5) mod 6 = 0 2-1 = 4.

` ` ` ` A multiplicative group. Consider the set of integers Zn for some integer n a *n b means (a*b) (mod n) Define the multiplicative group (Z* n .n)=1} . *n ) The elements of this group Z* n are the elements in Zn that are relatively prime to n ` Z* n = { [a]n Z such that: gcd(a.

8. Z*n = {1. 14 } Group operation is a*b (mod 15) 8*11 = 13 (mod 15) The group identity is 1 x 8*1 = 8 (mod 15) ` Below is the group ( Z*15 . 11. 4.n)= 1} For n = 15.` ` ` ` A multiplicative group modulo n example Z*n = { a Z*n : gcd(a. *15 ) . 7. 2.13.

2-1 = 8.*15 1 2 4 7 8 11 13 14 1 1 2 4 7 8 11 13 14 2 2 4 8 14 1 7 11 13 4 4 8 1 13 2 14 7 11 7 7 14 13 4 11 2 1 8 8 8 1 2 11 4 13 14 7 11 11 7 14 2 13 1 8 4 13 13 11 7 1 14 8 4 2 14 14 13 11 8 7 4 2 1 Multiplicative Group Z*15 Identity is 1 Inverses 1-1 = 1. 4-1 = 4: 7-1 = 13: 8-1 = 2: 11-1 =11: 13-1 = 7: 14-1 = 14 7*13 (mod 15) = 91 mod 15 (mod 15) = 1 (mod 15) .

ax=1 (mod n) .` ` ` ` ` ` For some a Z*n . let (d. Claim is that x is the inverse of a. y ) be the output from a call to Extended-Euclid(a. n) Since a and n are relatively prime. x. So 1 = a*x + n*y. Since n*y mod n = 0. d = 1.

` Thus [x]n is the inverse of [a]n in Z*n. .

x= -2. y=1). The multiplication table will have rows from 1.10 and columns from 1. n) returns ( d=1. Taking the Extended-Euclid (a. Download Extended-Euclid spreadsheet: ExtendedEuclidSlidePresentationFall07.. Since 11 is prime.xls So the multiplicative inverse of 5 is -2..10. But the representative of class [-2]11 is the positive value -2 + 11 = 9 (5*9) mod 11 = 45 mod 11 = 1 So 5 and 9 are inverses of each other . 5 is relatively prime to 11.Example: Let a = 5 and n = 11.

* 1 2 3 4 5 6 7 8 9 10 1 1 2 3 4 5 6 7 8 9 10 2 2 4 6 8 10 1 3 5 7 9 3 3 6 9 1 4 7 10 2 5 8 4 4 8 1 5 9 2 6 10 3 7 5 5 10 4 9 3 8 2 7 1 6 6 6 1 7 2 8 3 9 4 10 5 7 7 3 10 6 2 9 5 1 8 4 8 8 5 2 10 7 4 1 9 6 3 9 9 7 5 3 1 10 8 6 4 2 10 10 9 8 7 6 5 4 3 2 1 Table For Z*11 1 is unity 5 and 9 are inverses of one another .

The size of Z*n is denoted by Euler¶s J phi function: J(n) = n (1 (1 / p)) p/n where p runs through all primes that divide n If n=45. 5} So the size Z*n is J (45) = 45 ( 1.1/3) (1 ± 1/5)= 45 *(2/3)*(4/5) = 24 . Primes that divide n = { 3.

The size of Z*n when n is prime.1/n)= n( n -1)/n = n -1 If n=11 a prime. sp p = n J (n) = p (1 (1 / p)) p/n = n ( 1. The size Z*11 is J (11) = 11 ± 1 =10 . n is the only integer that divides itself .

The size Z*11 is J (11) = 13 ± 1 =12 .The size of Z*n when n is prime.1/n)= n( n -1)/n = n -1 If n=13 a prime. n is the only divides itself : J (n) = p (1 (1 / p)) p/n = n ( 1.

` ` ` ` Find the solutions to ax=b (mod n) where a > 0. or one or more than one solution The equation ax=b (mod n) is solvable if and only if gcd(a.n) | b The equation ax=b (mod ) either has d distinct solutions modulo n . . n > 0. where d = gcd(a. The equation has zero.n) or has no solutions.

If d | b 3.y¶) = EXTENDED-EUCLID(a. for i 0 to d-1 5.n) 2. else print ³no solutions .b. do print ( x0 + i (n/d) ) mod n 6. (d. x¶.n) 1. then x0 x¶ (b/d) mod n 4.MODULAR_LINEAR_EQUATION_SOLVER(a.

n) = 1. the Extended ± Euclid Algorithm yiels the inverse of a . Therefore. gcd(a.` ` When for any n > 1. The result above for equation ax = 1 (mod n) has a unique solution x0 ` ` This solution is the unique multiplicative inverse of ³a´ modulo n. then the equation ax = b (mod n) has a unique solution modulo n.

and 7 respectively. .and 2 when divided by 3.3.` Solves problem of finding those integers that leave the remainder 2. 5. One solution is x = 23 All solutions are of the form 23 + 105k for arbitrary integers k is the general solution.

5.and 7) and an equation modulo there product 3*5*7=105 = n Theorem shows that Zn is identical to the Cartesian product Zn1 x Zn2 x «««x Znk n = n1 * n2 *«nk ni µs are pair-wise-relatively prime With component-wise addition and multiplication modulo n .` ` Theorem relates pair-wise relatively primes (say 3.

b) mod n ( (a1 .bk) mod n ) . « ((ak .` ` ` ` Operations performed on elements of Zn can be equivalently performed on the elements in Znk µs. « ((ak * bk) mod n ) (a .b1 ) mod n . (a + b) mod n ( (a1 + b1 ) mod n . « ((ak + bk) mod n ) (a * b) mod n ( (a1 * b1 ) mod n .

a2. Consider a > (a1 . «.Let n = n1 * n2 *«nk where the ni s are pairwise relatively prime. . ak ) where a Zn and ai Zni and ai = a mod ni for i = 1 to k.

For example let n = 5* 13 * 4 = 260 The pairs (5. and 0 in Z4.13). (5.4) are relatively prime. 0 ). Let a = 32. . So 32 > ( 2. 6. a3 = a mod n3 = 32 mod 4 = 0 . a1 = a mod n1 = 32 mod 5 = 2. 32 in Z corresponds to (2. 6 in Z13 . 0 ). 6. 2 in Z5.4) and (13. a2 = a mod n2 = 32 mod 13 = 6 .

«. . 6 in Z13 . ak ) is a one to one mapping between Zn and Zn1 x Zn2 x«x Znk For example above 32 in Z260 corresponds to (2 in Z5. a2. 0 in Z4).Then the mapping above of a to (a1 .

b2. If a > (a1 . a2. bk ). (ak + bk) mod nk ).The operations performed on the elements of Zn can be equivalently performed on on the corresponding k-tuples by performing the operations independently in each coordinate position in the appropriate position. (a2 + b2) mod n2. «. . ak ) and b > (b1 . The same holds for operations subtraction ans multiplication. the ( a+ b) mod n > ( (a1 + b1) mod n1 .«. «.

37 > (2. 1 ) from above and 18 > (3 . 2 ) So (37 * 18) mod 260 > (2*3 mod 5. 11. 11*5 mod 13. 3 . 2) . 5.For example. 1*2 mod 4) Further (37 * 18 ) mod 260 = 146 So 146 > (1.

Also given (1. 2 ). 2). 146 > ( 146 mod 5. 2) Check it. 146 can be computed as folllows. 3 . 146 mod 13. . 3 . 3. 146 mod 4) = ( 1.So 146 > (1.

2 ). 3 .Let mi be the product of n1 n2 ni-1 ni+1« nk . 146 mod 4) = ( 1. the product excluding ni. 146 > ( 146 mod 5. m1 = n2 n3 = 13 * 4 = 52 m2 = n1 n3 = 5 * 4 = 20 m3 = n1 n2 = 5 * 13 = 65 . 146 mod 13.

So c1 = 52*3 = 106 So m2 = n1 n3 = 5 * 4 = 20 m3 = n1 n2 = 5 * 13 = 65 . 2 ). 146 mod 13. 3 . the product excluding ni. 52* x mod 5 = 1? x=3 for 52*3 mod 5 = 106 mod 5 = 1. 146 mod 4) = ( 1. m2-1ni-1 ni+1« 146 > ( 146 mod 5.Calculate coefficients ci = mi (mi-1 mod ni ) . m1 = n2 n3 = 13 * 4 = 52.

the product excluding ni.Calculate coefficients ci = mi (mi-1 mod ni ) . 3 . 2 ). m1 = n2 n3 = 13 * 4 = 52. 146 mod 13. 146 mod 4) = ( 1. 52* x mod 5 = 1? x=3 for 52*3 mod 5 = 106 mod 5 = 1. m2-1ni-1 ni+1« 146 > ( 146 mod 5. So c1 = 52*3 = 106 So m2 = n1 n3 = 5 * 4 = 20 m3 = n1 n2 = 5 * 13 = 65 .

If n = n1 * n2 *«nk where the ni s are pair-wise relatively prime then for all integers x and a. x = a (mod ni ) for all i =1 to k if and only if x = a (mod n). .

2. Select a small odd integer e that is relatively prime to J (n). J =(p-1)(q-1) (n) Suppose p = 13 and q = 19. J n= 13* 19 = 247 .` ` ` ` ` 1. (p-1) = 12 and (q-1) = 18. Select two very large prime numbers p and q. Find a small odd integer relatively prime to 216. Let n = p*q 3. (n)= 12*18=216. p q.

For example can pick e = 11. 54 = 2*27 So 216 = 23 * 27 Repeatedly Divide 27 by 3: 27 = 33. So 216 = 23 33 .Repeatedly divide 216 by primes to get its factorization Divide by 2: 2 into 216 = 2*108. Pick any odd integer relatively prime to 216. 108= 2*54. So the pair (e=11. n = 247 ) is the RSA public key .

So 216 = 23 33 . 108= 2*54. For example can pick e = 5. 54 = 2*27 So 216 = 23 * 27 Repeatedly Divide 27 by 3: 27 = 33.Repeatedly divide 216 by primes to get its factorization Divide by 2: 2 into 216 = 2*108. So the pair (e=5. Pick any odd integer relatively prime to 216. n = 247 ) is the RSA public key .

n = 247 ) is the RSA public key .Publish the pair (e=5.

Use Extended-Euclid to find the inverse of the public key e in the set Z* J(n) . 247> Keep <173. Call Extended-Euclid(e.` ` ` 4. n> = < 173. J (n) ) Call Extended-Euclid(5. 247> secret . 216 ) Solve ax = 1 mod 216 for x See next slide for spreadsheet output x from Extended_Euclid is the private key d d is 173 ` ` Private key pair = < d.

Extended-Euclid to Calculate Inverse of e =5 for J (n) = 216 -43 + 216 = 173 Positive inverse a 5 216 5 1 b 216 5 1 0 floor(a/b) 0 43 5 d 1 1 1 1 x -43 1 0 1 y 1 -43 1 0 173 .

` ` ` Encrypts messages sent between two communicating locations Eavesdroppers who overhear messages should not be able to de-crypt them Parties who communicate can append an unforgeable ³signature´ to the end of the electronic message .

.` RSA system based upon the ease in finding very large prime numbers and the difficulty in factoring the product of two prime numbers.

.` ` ` Each participant has both a public and a private ( secret ) key Traditionally. the two participants are called ³Alice´ and ³Bob´. Their public and private keys are denoted by PA and SA for Alice and PB and SB for Bob.

The public and private keys can be applied to any message Let denote the set of all permissible messages by D.` ` ` ` Each participant creates both their public and private key Each keeps their secret key secrete. . but can reveal their public key to anyone or publish it in a public directory.

`

`

`

`

The public and private keys specify a one-to-one function of D to itself. The function corresponding to Alice¶ s public key is denoted by PA() . The function corresponding to Alice¶ s private key is denoted SA() . The corresponding functions for Bob are PB() and SB().

`

` `

These functions form a ³matched pair´ in that they are specified as inverses of one another. M= SA(PA(M)) for any message M. M= SB(PB(M)) for any message M.

`

`

It is essential that no one but Alice be able to compute SA in any practical amount of time. The privacy of mail sent that is encrypted and sent to Alice and the authenticity of Alice¶ signature is based on the assumption that only Alice can compute SA.

Alice must keep her secret key secret even everyone knows her public key PA and they can compute her public key efficiently.

Bob encrypt M M Plain-text PA Communication channel C=PA (M) Alice decrypt SA M =S (PA (M) ) eavesdropper C ± the encoded text Cipher-text Bob encrypts a message sent to Alice Alice encrypts a message sent to her using Alice¶s public key obtained from a using her secret key directory .

Transformation is P(M) = Me (mod n) Transformation of cipher-text message C Associated with the private key ( d. n ). ` ` Transformation is S(C) = Cd (mod n) .` ` Transformation of plaintext message M Associated with the public key ( e. n ).

n = 247 ) is the RSA public key and < 173. Assume the plaintext message M is the character µa¶ whose integer (ASCII) value in decimal is 97.508537038405599006539868283061e+391 mod 247 = 97 which was the original message µa¶ that was sent. Encrypt the character ¶a¶. Decrypt the message S(C) =184173 (mod 247) = 6. 247> is the RSA private key. . The cipher text message is: C = P(M) = 975 (mod 247) = 8587340257 (mod 247) = 184.Assume the pair (e=5.

Given: 1st prime number p = 11 2nd prime number q = 29 Public key e = 3 Find the Private key d? Calculate: n = p * q = 11 * 29 = 319 J (n) = (p ± 1) * (q ± 1) = 10 * 28 = 280 .

From below the Secret key d = 187 J (n) = 280 a 3 3 1 b 280 1 0 floor(a/b) 0 3 d 1 1 1 x y 1 1 0 Inverse in problem 31. solve the Extended-Euclid-Algorithm for a = and for b = the Public key e = 3 .7-1 -93 0 1 187 = 280 + (-93) = 187 The smallest positive integer in the class .To calculate the secret key d.

.With the Public key e = 3 and the Secret key d = 187 and n = 319 the encoding and decoding of Message M = 100 can proceed. Encode (Encrypt) M = 100: M e mod n = (100) 3 mod 319 = 1000000 mod 319 = 254 The encoded (encrypted) value sent is C = 254.

With the Public key e = 3 and the Secret key d = 187 and n = 319 the encoding and decoding of Message M = 100 can proceed. Decode (Decrypt ) C = 254: C d mod n = (254) 187 mod 319 = 5. The same results can be obtained by executing the RSAProblemSetAnswers class in the RSASecurityAlgorithmNetBFall06 NetBeans Project .0571403642522761487477741975759e+449 mod 319 = 100 The Original Message M = 100 is re-constructed.

decrypt calculation with the pair <e=197.d=253>. Do the encrypt. . private key pairs that will work. Then run it through RSAProblemSetAnswers to check that it works.Executing the RSAProblemSetAnswers class also gives many other public key.

.` The utility of the RSA technique depends of the efficiency of doing the exponentiation say184173.

Computation form ab mod n .` ` To encode or decode messages. fast modular exponentiation is necessary.

Convert exponent b=22 to binary Its binary representation is as follows: i bi 4 1 3 0 2 1 1 1 0 0 .Consider computing 722 .

Convert exponent b=22 to binary Its binary representation is as follows: i bi 4 1 3 0 2 1 1 1 0 0 22 represented as a base two number is: 1* 24 + 0* 23 + 1* 22 + 1* 21 + 0* 20.Consider computing 722 . .

Consider computing 722 . Convert exponent b=22 to binary Its binary representation is as follows: i bi 4 1 3 0 2 1 1 1 0 0 Raise 7 to this exponent 1* 24 + 0* 23 + 1* 22 + 1* 21 + 0* 20 7 .

Raise 7 to this exponent 1* 24 + 0* 23 + 1* 22 + 1* 21 + 0* 20 7 = 24 0 22 21 0 7 *7 *7 *7 *7 = 716 *1 *74 * 72 *1 Total # multiplications is 15 + 1 + 1 + 3 +1 + 1 + 1 = 23 .

e =0 a* x4 + b* x3 + c* x2 + d* x1 + e Factor x repeatedly ( ( ( ax + b)x + c)x +d)x + e . d=1.Consider exponent as a polynomial of degree 4 in x for x = 2 a =1. c=1. b=0.

e =0 Raise 7 to this power x ( ( ( a*x + b)*x + c)*x +d) *x + e 7 ( ( ( a*x * b )*x + c)*x +d) *x + e ( ( ( 7 ax * 7b 1+0+1+0+ )x * 7c )x *7d )x * 7e = . d=1.Consider exponent as a polynomial of degree 4 in x for x = 2 a =1. c=1. b=0.

c=1. d=1. e =0 Raise 7 to this power x ( ( ( a*x + b)*x + c)*x +d) *x + e 7 ( ( ( a*x * b )*x + c)*x +d) *x + e ( ( ( 7 2 * 70 1+0+1+0+ )2 * 71 )2 *71 )2 * 70 = . b=0.Consider exponent as a polynomial of degree 4 in x for x = 2 a =1.

Consider exponent as a polynomial of degree 4 in x for x = 2 a* x4 + b* x3 + c* x2 + d* x1 + e Factor x repeatedly ( ( ( ax + b)x + c)x +d)x + e .

Consider computing 722 . Convert exponent b=22 to binary Its binary representation is as follows:

i bi

4 1

3 0

2 1

1 1

0 0

Raise 7 to this exponent

1* 24 + 0* 23 + 1* 22 + 1* 21 + 0* 20 7

Convert exponent b to binary For example let b = 560. Its binary representation is as follows:

i bi

9 1

8 0

7 0

6 0

5 1

4 1

3 0

2 0

1 0

0 0

i bi

9 1

8 0

7 0

6 0

5 1

4 1

3 0

2 0

1 0

0 0

Represented as a base two number 560 is: 1 * 29 + 0* 28 + 0* 27 + 0* 26 + 1* 25 + 1* 24 + 0* 23 + 0* 22 + 0* 21 + 0* 20. Reduce the number of multiplications by creative factoring Using Horner¶s Method

i bi 9 1 8 0 7 0 6 0 5 1 4 1 3 0 2 0 1 0 0 0 Represented as a base two number 560 is: 1 * 29 + 0* 28 + 0* 27 + 0* 26 + 1* 25 + 1* 24 + 0* 23 + 0* 22 + 0* 21 + 0* 20. Reduce the number of multiplications by creative factoring Horner¶s Method ( ( ( ( ( ( ( (1 *2 + 0)*2 + 0 )* 2 + 0)* 2 + 1)*2 + 1)*2+ 0)*2 +0)* 2 + 0)* 2 + 0 .

a(1*2 + 0) = a2 a0 = a2 * 1 = a2 .Modular exponentiation raises a to the power below mod n: ( ( ( ( ( ( ( (1 *2 + 0)*2 + 0 )* 2 + 0)* 2 + 1)*2 + 1)*2+ 0)*2 +0)* 2 + 0)* 2 + 0 a mod n Consider evaluating a(1*2 + 0) a1 = a a(1*2) = a2.

( ( ( ( ( ( ( (1 *2 + 0)*2 + 0 )* 2 + 0)* 2 + 1)*2 + 1)*2+ 0)*2 +0)* 2 + 0)* 2 + 0 Consider evaluating a(1*2 + 0)*2 + 1 a1 = a a(1*2) = a2. a(1*2 + 0) = a2 a0 = a2 a (1*2 + 0) * 2 = (a2 )2 = a4 a (1*2 + 0) * 2 + 1 = a4 * a = a5 .

a=7. n = 561 ( ( ( ( ( ( ( (1 *2 + 0)*2 + 0 )* 2 + 0)* 2 + 1)*2 + 1)*2+ 0)*2 +0)* 2 + 0)* 2 + 0 71 mod 561 = 7 mod 561 = 7 72 = 49 mod 561 = 49 72 70 mod 561 = 49 (49)2 mod 561 = 2401 mod 561 = 157 . Prevents the product from growing too large to be held in a word of the machine.The mod can be done after every multiplication instead of at end. Start problem on page 880 in book. b = 560.

The mod can be done after every multiplication instead of at end. n = 561 ( ( ( ( ( ( ( (1 *2 + 0)*2 + 0 )* 2 + 0)* 2 + 1)*2 + 1)*2+ 0)*2 +0)* 2 + 0)* 2 + 0 71 mod 561 = 7 mod 561 = 7 72 = 49 mod 561 = 49 72 70 mod 561 = 49 (49)2 mod 561 = 2401 mod 561 = 157 (157)2 mod 561 = 526 (526)2 mod 561 = 103 (103)*2 mod 561 = 206 . Start problem on page 880 in book. b = 560. Prevents the product from growing too large to be held in a word of the machine. a=7.

a=7.The mod can be done after every multiplication instead of at end. Start problem on page 880 in book. n = 561 ( ( ( ( ( ( ( (1 *2 + 0)*2 + 0 )* 2 + 0)* 2 + 1)*2 + 1)*2+ 0)*2 +0)* 2 + 0)* 2 + 0 (206)2 mod 561 = 361 361*2 mod 561 = 161 (161)2 mod 561 = 115 (115)2 mod 561 = 322 (322)2 mod 561 = 460 (460)2 mod 561 = 103 Not Correct . b = 560. Prevents the product from growing too large to be held in a word of the machine.

Alice must keep her secret key secret even everyone knows her public key PA and can compute it efficiently.` ` It is essential that no one but Alice be able to compute SA in any practical amount of time. . The privacy of mail sent that is encrypted and sent to Alice and the authenticity of Alice¶ signature is based on the assumption that only Alice can compute SA.

Evaluation of 7560 mod 561 pages 879-880 Kormen ( ( ( ( ( ( ( (1 *2 + 0)*2 + 0 )* 2 + 0)* 2 + 1)*2 + 1)*2+ 0)*2 +0)* 2 + 0)* 2 + 0 Consider evaluating a(1*2 + 0)*2 + 1 a1 = a a(1*2) = a2. a(1*2 + 0) = a2 a0 = a2 a (1*2 + 0) * 2 = (a2 )2 = a4 a (1*2 + 0) * 2 + 1 = a4 * a .

Sign up to vote on this title

UsefulNot useful- RSA and Eisenstein Integers
- Crypto
- 06 Number Theory and RSA
- modular arithmatic
- Lecture 12
- Ch4(2)
- RSA Notes
- Discrete Mathematics
- NS13-Public Ciphers RSA
- p742-l_ecuyer_RandomNumberGeneration_paper.pdf
- A Guide to RSA by Robert Yates
- Rsa
- rsa1
- RSA Project
- EX of RSA Algorithm
- Sec 41
- Rsa
- extra_new
- Basic Number Theory
- Book
- Spring 12 Berg Jake
- Arithmetic Operators
- Cryptography - Number Theory an Related Alghoritm in Cryptography
- new algo
- UNITi.docx
- Handout Csi4138 Ecc 2002
- Teoria de numeros
- A Simple, Recursive Formula for Generating Divisibility Rules in Base 10 for Any Integer Relatively Prime to the Integer 10
- Abstract Algebra - Wilkins
- Rsa
- Number Theoretic Algorithms