title: Modular arithmetic
body: <p>I'm new to cryptography and modular arithmetic. So, I'm sure it's a silly question, but I can't help it. </p>
  
  <p>How do I calculate <em>a</em> from <br>
  &nbsp;&nbsp;&nbsp;&nbsp; pow(<em>a</em>,<strong>q</strong>) = 1 (mod <strong>p</strong>), <br>
  where <strong>p</strong> and <strong>q</strong> are known? I don't get the "1 (mod <strong>p</strong>)" part, it equals to 1, doesn't it? If so, than what is "mod <strong>p</strong>" about? <br>
  Is this the same as <br>
  &nbsp;&nbsp;&nbsp;&nbsp; pow(<em>a</em>,<strong>-q</strong>) (mod <strong>p</strong>) = 1?</p>