11.07.2015 Views

Abstract Algebra Theory and Applications - Computer Science ...

Abstract Algebra Theory and Applications - Computer Science ...

Abstract Algebra Theory and Applications - Computer Science ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

106 CHAPTER 6 INTRODUCTION TO CRYPTOGRAPHY(b) Write a program to implement the following factorization algorithmbased on the observation in part (a).x ← ⌈ √ n ⌉y ← 11: while x 2 − y 2 > n doy ← y + 1if x 2 − y 2 < n thenx ← x + 1y ← 1goto 1else if x 2 − y 2 = 0 thena ← x − yb ← x + ywrite n = a ∗ bThe expression ⌈ √ n ⌉ means the smallest integer greater than or equalto the square root of n. Write another program to do factorization usingtrial division <strong>and</strong> compare the speed of the two algorithms. Whichalgorithm is faster <strong>and</strong> why?2. Primality Testing. Recall Fermat’s Little Theorem from Chapter 5. Let pbe prime with gcd(a, p) = 1. Then a p−1 ≡ 1 (mod p). We can use Fermat’sLittle Theorem as a screening test for primes. For example, 15 cannot beprime since2 15−1 ≡ 2 14 ≡ 4 (mod 15).However, 17 is a potential prime since2 17−1 ≡ 2 16 ≡ 1 (mod 17).We say that an odd composite number n is a pseudoprime if2 n−1 ≡ 1 (mod n).Which of the following numbers are primes <strong>and</strong> which are pseudoprimes?(a) 342(c) 601(e) 771(b) 811(d) 561(f) 6313. Let n be an odd composite number <strong>and</strong> b be a positive integer such thatgcd(b, n) = 1. If b n−1 ≡ 1 (mod n), then n is a pseudoprime base b.Show that 341 is a pseudoprime base 2 but not a pseudoprime base 3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!