Hmk5-Sol - CIS 3362 Homework#5 Solution Number Theory RSA...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 3362 Homework #5 Solution Number Theory, RSA Due: Wednesday, 11/10/2010 1) Determine the following values: a) Φ(235) = Φ(5 x 47) = (5 – 1)(47 – 1) = 184 b) Φ(5045) = Φ(5 x 1009) = (5 – 1)(1009 – 1) = 4032 c) Φ(6034176)= Φ(2 8 x 3 5 x 97) = (2 8 – 2 7 )(3 5 – 3 4 )(97 – 1) = 1990656 d) Φ(646000000) = Φ(2 7 x 5 6 x 17 x 19) = (2 7 – 2 6 )(5 6 – 5 5 )(17 – 1)(19 – 1) = 230400000 e) Φ(55898489) = Φ(7129 x 7841) = (7129 – 1)(7841 – 1) = 55883520 Note: A calculator was used to prime factorize (a) through (d), but the program below was used to prime factorize (e): #include <stdio.h> int main() { int val = 55898489; // Hard-coded for problem 1e. int div = 2; while (div <= val) { // Found a divisor, print and go on. if (val%div == 0) { printf("%d\n", div); val /= div; } else div++; } return 0; } 2) Without the aid of any computing device, show how one can use Euler's Theorem to determine the remainder when 53 2378 is divided by 259. Φ(259) = Φ(7 x 37) = (7 – 1)(37 – 1) = 216. Thus, according to Euler’s theorem, 53 216 ≡ 1 mod 259. 53 2378 = 53 2376 53 2 = (53 216 ) 11 53 2 ≡ 1 11 (2809) ≡ 219 mod 258 3) A primitive root, α, of a prime, p, is a value such that when you calculate the remainders of α, α 2 , α 3 , α 4 , . .. , α p-1 , when divided by p, each number from the set {1, 2, 3, . .., p-1} shows up exactly once. In fact, one can simply check if α is a primitive root by calculating these remainders and seeing the first exponent that produces a remainder of 1. If p-1 is that exponent, then α is a primitive root. Write a short program that prompts the user to enter a prime number, p, and then tells the user each primitive root in the set {1, 2, 3, . .., p-1}. You are guaranteed that
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
the user won’t enter a p greater than 10000. (This means that you can use a typical brute force algorithm to solve the problem.) Please attach your code. Here is Java code to solve the problem: // Arup Guha // 11/2/09 // Program used to prime factorize numbers for CIS 3362 Homework#5 Q#3 // Asks the user for a prime and determines all of its primitive roots. import java.util.*; public class primitiveroot { public static void main(String[] args) { // Get the user's prime. Scanner stdin = new Scanner(System.in);
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/13/2011 for the course CIS 3362 taught by Professor Staff during the Fall '08 term at University of Central Florida.

Page1 / 6

Hmk5-Sol - CIS 3362 Homework#5 Solution Number Theory RSA...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online