Is this prime number large enough / too large for a Diffie-Hellman for AES-256?

AES-256 and a 8192-bit DH modulus are both overkill. Comparing them with each other is a delicate exercise which verges on the meaningless, since both are quite far into the realm of "can't break it now, can't do it in 30 years either". You can have a look at this site for information and calculators on various ways to estimate relative strength of symmetric and asymmetric algorithms.

Practical parameters which can be recommended now for proper security are AES-128 and a 2048-bit DH prime modulus (with 256-bit exponents).


Yes. You are ridiculous in choosing AES-256 and 8192 bit DH.

There are several things which you may want to consider.

  1. Are you protecting enterprise data ? If yes, then you can actually be happy with AES-128 and 2048 bit DH. The reason is simple. AES-256 has export control polices and if you want to package your app, then you must use special jar(if you are using JAVA) etc.. But, you can use AES-256. No probs. Also, it is slow if you are using anything above 2048 bit DH. You must also take care of the system on which data will be decrypted. It shouldn't take too much of time. Lots of Fortune-1000 companies still use 3DES and you are using AES which is a far better algorithm. So you are safe with AES-128 and 2048 DH

  2. Are you protecting data private to a small closed group? Then, you just need AES-128 and 2048 bit DH. Anything more than that is not needed as the time frame you are looking at is just 10 years.

If you really want more security and want to future proof it, then DH is the wrong way forward. Elliptic Key Cryptography is best suited for this. Not many resources in this direction. But, it is definitely worth it.

Bottom line - Size isn't everything in Cryptography. The correct choice of algorithms and implementation is what that actually counts. Go ahead with AES-128 and 2048 bit DH. It is safe.

UPDATE:

@stefano - Hi, There are several things which must be considered since you said governmental espionage in journalists. Governments never tell us their real capacity. So, it is possible that they have already have infrastructure to crack AES-256. NSA won't approve something that goes above their head. Also, AES is not the highest level of security available. It forms the tier-2 in NSA algorithm stack if my memory is correct. But, we have limited options. So we can go with AES-256 to provide better security.

To provide better security in the long term, you must consider Elliptic Key Cryptography. It is the only system that is available in public that can future proof things in a reasonable manner. DH can be used when you want to transfer data between 2 or more parties. I'm assuming that you know the basics of asymmetric key cryptography and why you need DH. If you are storing data in your system and not transferring it, there is no need for DH or RSA or Elliptic Key Cryptography.

Also, you can use a very strong password which will directly influence the key selected in AES through salting and SHA-512, This will provide you with the ability to change the encrypted text once in a while so that a weak key that comes up in some journal will not trouble your encrypted data. 256-bit exponent is fine. But, for your current scenario, a little higher exponent can do a better job.


Yes. Your approach is way over the top. AES-128 and a 2048-bit Diffie-Hellman group (with a 256-bit exponent) is more than sufficient. Even with those parameters, it is exceptionally unlikely that the crypto-math is the weakest link in your system. Your system is much more likely to be broken by bypassing the crypto, than by breaking the crypto head-on.