In a Diffie-Hellman exchange, the parties need to agree on a prime p
and a base g
in order to continue. Assuming some application that's going to want to initiate handshakes with some large portion of its users, each of which only need to be realistically secure for a few hours,
- Approximately how large should
p
be? - How often should
p
be changed, if ever? Every n handshakes, every m hours/days/weeks? - Is there a trade-off between dynamic generation/size of
p
? That is, is it better to find a single ~120 digit prime and constantly reuse it, or to generate a shit-ton of ~28-38 digit primes and randomly pick one per handshake? - Am I even asking something approaching the right questions (and if not, could you point me in a better direction)?
Intuitively, it seems that size of the chosen secret integers has more to do with the security of the channel than the uniqueness of p
, but I'm still asking since I'm no mathematician.