ElGamal+Fall+2011

Now that we've actually been Bob and Alice, let's address our ElGamal needs.

1. Surf for Primitives of primes. Let's store a list here. We want primes of more than five digits. I found this for calculating primitive roots of primes online. It works fastest for primes that are < 5 digits, but still works for > 5 digits. [] Example: P=104287, primitive roots include: 5, 6, 12, 2353, 9119, 12502, and lots more. There are 27360 of them. user:kml003 I used the site Kayla found to get a few. 100501 has 26400 primitive roots, including 2, 10, 13, 14, 18, 985, 30446, 67036, and 96162. 101141 has 37248 primitive roots. 3, 7, 10, 12, 18, 483, 25719, 50808, and 90035 are some. 102559 has 34184 primitive roots, some of which are 3, 12, 14, 23, 24, 476, 16542, 49111, and 90570. 103349 has 44280 primitive roots, including 3, 10, 12, 14, 15, 701, 25800, 66232, and 103107. user:meganternes

2. Let's build a Maple program to find primitives for us. Here is a brief list of 4 digit primes to use for debugging. 6473 7393 8209 8969 9923

i think megan and I were editing at the same time so my work was erased, but if I remember correctly, my program was: findprim:=proc(p,g) for i from 1 to p-1 do if g&^i mod p =1 then print(i) end if end do end proc which I think is essentially the same as your program? but it seemed to work for me, i got a few of the primitives for 6473 and 7393 user:bea001

Take a look at this early attempt at primitive root finding. Do you see the humor? By the way, 37 is not a primitive root of 73.

3. Make an example of a collision by planning out a non-primitive root of a prime, finding two texts that encrypt to the same cipher or two ciphers that decrypt to the same plaintext. I'm not sure if I'm doing this right, but I tried a couple. 1) P=17, alpha=2, so beta=1 (a is 8) m=127, so t=8, r=9 (k is 7)  Then we want a different message that encrypts to (9, 8), right? If the message was 144, t is still 8, so you would still have (9,8).  2) P=83, alpha=3, beta=12 (a is 9) m=127, so t=37, r=25 (k is 11) A message of 210 should give t=37 also. When I tried encoding a message actually using a primitive root of a prime, I wasn't getting the message back, so those two problems could easily be wrong as well. user:meganternes