6.6 OFF TO THE RACES!

EXERCISE 6.6: OFF TO THE RACES!

Write a python program to generate a thousand or so \(2048\)-bit RSA private keys and a program to generate a thousand or so DH and ECDH keys. How does the performance compare?


Obivously generating DH & ECDH keys will be way much faster than generating RSA keys. But why is that??

Once the public parameters are established in DH, i.e. a generator and a 2048 bit prime number (which can take a significant time to generate), one can generate as many private and public Diffie-Hellman keys at the speed of modular exponentiation (which is really fast).

On the other hand when we generate a 2048 bit RSA key, we are generating 2 huge private numbers, which is way slow when compared to modular exponentation.