In the DH algorithm $ a^x \bmod b $ where $ a $ is the generator and $b $ is the prime modulus does $b $ have to be bigger than $ a $ or could $ a $ be larger for example $ 19^x \bmod 17 $ . Because I don't see a problem with the generator being larger because the answer can still only be $ b \ge \text{answer} > 0 $ . Obviously the prime modulus would still have to be large enough to provide good security but I was just curious if the generator could be larger.


1 Answer 1


I suppose there is really no requirement to have $a <b$. But then again, if you are using an $a>b$ why not reduce it modulo $b$ and save space?

  • 2
    $\begingroup$ I was just curios $\endgroup$
    – Nat
    Jul 28, 2017 at 17:58
  • 3
    $\begingroup$ It's good to be curious 😊 $\endgroup$
    – Guut Boy
    Jul 28, 2017 at 17:59
  • 6
    $\begingroup$ Ugh, emoji in comments. >:( $\endgroup$
    – Wildcard
    Jul 29, 2017 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.