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 needs 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
? Is it better to find a single ~120 digit prime and always reuse it or generate a 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 the size of the chosen secret integers has more to do with the channel's security than the uniqueness of p, but I'm still asking since I'm no mathematician.