Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A big number modulo a prime

  1. Dec 12, 2012 #1
    Im looking through old exams for a course in Cryptography and have beaten my head against the wall for a long time on one of the questions:

    p = 683 is a prime, p-1 = 2*11*31. What is x = 4^11112 mod p?

    When i did chinese remainder theorem on primes 2,11,31 i got that x = 16 mod 682, but so far i have not found a way to use this in determining x mod 683..

    Also, when computing discrete logs I have found that one goes from mod p to mod (p-1) alot, why is that?
     
  2. jcsd
  3. Dec 12, 2012 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Can you use a computer to calculate it?
    The common general approach to calculate a^b mod c will give you the answer in milliseconds.
     
  4. Dec 12, 2012 #3
    It is supposedly solvable by hand, but I'm wondering if it was meant to calculate mod p-1 instead of p. Atleast thats what I'll conclude if no one finds another answer.

    Also, it seems that the answer is 16 mod 683 as well. Perhaps there is some once-in-a-lifetime connection between 682 and 683 for this task?
     
  5. Dec 12, 2012 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    4^11 = 2^22 = 1 mod 683

    I would expect that there is some way to get this from p-1=2*11*31.
    The rest is easy, as 11112 = 11*1010 + 2.

    4^6 = -2 mod 683 is quite interesting, too.
    It is possible to calculate that by hand, but then you don't need the hint.
     
  6. Dec 12, 2012 #5
    4 is quadratic residue, so 4^(p-1)/2 = 1 mod p, but then i get 4^11*31 = 1 mod p, and i need to get rid of 31.. Otherwise i get stuck with 4^200 mod p. I'll try to figure something out, thanks for the help!
     
  7. Dec 12, 2012 #6
    The solution is to use Fermat's little theorm. To use that you need 11112 mod 682 not x mod 682.
     
  8. Dec 12, 2012 #7
    Fermat gives 4^11112 = 1*4^200 mod p, so that gets me a little further, but not quite there.
     
  9. Dec 12, 2012 #8
    Knowing that 4^200 =(((4^5)^2)^2)^5 should help
     
  10. Dec 12, 2012 #9
    That does help, its just that i want to find a better way of doing it! Usually these things turn out to be some number squared or something, so I feel like im doing something wrong if i compute too much :p
     
  11. Dec 12, 2012 #10
    p-1=2*11*31 is also phi(p), and the order of any number (for example, 2) mod p is going to be a divisor of phi(p). So there are not many combinations to try in order to find a divisor d of phi(p) such that 2^d =1 mod p.
     
  12. Dec 12, 2012 #11

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    I think this is the trick. You still have to calculate 4^2 mod p (trivial) and 4^6 mod p (you can stop calculating 4^11 here if you see 4^6 = -2 mod p and therefore 4^11 = 1 mod p), but you know that you don't have to calculate anything beyond 4^11.
     
  13. Dec 13, 2012 #12
    Indeed, that does help. Thank you everyone for helping out!
     
  14. Dec 15, 2012 #13
    The way I did it was
    4^682=1 mod 683
    (4^219)(4^463)=1mod 683
    Then 4^11=1 mod 683
    You can surely simplify 4^219 by using that

    The rest should be clear.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: A big number modulo a prime
  1. Prime number. (Replies: 7)

  2. Prime Numbers (Replies: 1)

Loading...