Homework 9

Due date: Monday, April 3

6 points per question.

1) Problem 10.19

2) Use the method based on Fermat's Little Theorem to find out whether 27 and 29 are likely prime or not. Give intermediate results.

3) Using p=5 and q=7, generate a public and a private key for RSA as shown in class. Use the keys to encode the message 12, then decode your result. Show all intermediate results.

4) Simulate the execution of randomized caching. Your cache is an array of size of 3, and your program is requesting the following items in the sequence given: A, D, D, E, A, B, A, D, B, C, E, D.
Show the state of the cache after each request. Show which items are in the cache, and which are marked. The cache is filled from left to right, and whenever an item needs to be evicted, pick a "random" index into the cache.


CS 324 Spring 2006