Diffie-Hellman group sizes: the modulus is 2048 to 8192 bits
RFC 7919 defines five finite-field Diffie-Hellman groups, named ffdhe2048, ffdhe3072, ffdhe4096, ffdhe6144 and ffdhe8192, with modulus sizes of 2048, 3072, 4096, 6144 and 8192 bits. Each group uses the generator g = 2, and the TLS registry assigns them values 256 to 260. In TLS 1.3, each public value is a big-endian integer left-padded with zeros to the size of the modulus in bytes, so every public key for a given group has the same length: 256 bytes for ffdhe2048, 384 for ffdhe3072, 512 for ffdhe4096, 768 for ffdhe6144 and 1024 for ffdhe8192. These byte counts follow directly from the bit sizes and are the figures to use when sizing handshake buffers.
This table is for engineers who size TLS handshake buffers and audit which groups a server will negotiate. Handshake buffers must hold the key share for the group chosen, so a server that offers the larger groups should allow for the extra bytes per key share. Auditors should compare the configured group list against the five ffdhe groups and confirm which of them the server actually offers, since a larger group does not help if a client never selects it. The sizes here are the baseline against which elliptic-curve key shares, which are much smaller at similar estimated strengths, are usually compared.
RFC 7919 gives each group an estimated symmetric-equivalent strength: 103 bits for ffdhe2048, 125 for ffdhe3072, 150 for ffdhe4096, 175 for ffdhe6144 and 192 for ffdhe8192. It also suggests a secret exponent of at least 225, 275, 325, 375 and 400 bits respectively. Those exponent lengths apply only to peers that use the short-exponent optimization described in RFC 7919, Section 5.2. Peers that do not use it should not assume the shorter exponent is enough, so confirm which behavior your TLS library follows before relying on the suggested figures.
When reviewing a configuration, check two things. First, confirm the negotiated group matches the modulus size you expect, because the public key length in the handshake reveals which group was used. Second, confirm peers validate the other side's public value Y by checking 1 < Y < p-1, as RFC 7919, Section 5.1 requires. Confirm with your TLS library's documentation and your own test traffic how these checks and exponent choices are implemented in the versions you run, because the RFCs describe requirements and the library defines what it does.
ffdhe group modulus, registry value, generator and rated strength
This table lists each standard ffdhe group from RFC 7919 with its modulus size, TLS registry value, generator, rated symmetric-equivalent strength and suggested minimum secret exponent. Read each row as one group's full parameter set, since the rated strength and the exponent size belong to the same group and should be sized together. The main takeaway is that the rated strength rises with the modulus, while the suggested exponent length grows more slowly, so a larger group does not automatically require proportionally longer secrets. Confirm the exact values against RFC 7919 before you configure a server or client.
| Group | Modulus size (bits) | TLS registry value | Generator g | Rated strength (bits) | Suggested minimum secret exponent (bits) |
|---|---|---|---|---|---|
| ffdhe2048 | 2048 | 256 | 2 | 103 | 225 |
| ffdhe3072 | 3072 | 257 | 2 | 125 | 275 |
| ffdhe4096 | 4096 | 258 | 2 | 150 | 325 |
| ffdhe6144 | 6144 | 259 | 2 | 175 | 375 |
| ffdhe8192 | 8192 | 260 | 2 | 192 | 400 |
How to read the ffdhe group columns
Each row in the ffdhe table describes one named group that RFC 7919 defines for finite-field Diffie-Hellman. The modulus p column gives the size of the prime in bits: 2048, 3072, 4096, 6144 or 8192 for ffdhe2048, ffdhe3072, ffdhe4096, ffdhe6144 and ffdhe8192. The TLS registry value column gives the number that identifies the group in the TLS supported groups registry, which ranges from 256 to 260. The generator g column is 2 for every group. Each row is sourced from its own appendix in RFC 7919, so ffdhe2048 comes from Appendix A.1, ffdhe3072 from Appendix A.2, and so on through Appendix A.5 for ffdhe8192. When you check a row against the RFC, start from the appendix named for that group.
The symmetric-equivalent strength column gives the security level that RFC 7919 attaches to each group, in bits: 103, 125, 150, 175 and 192 for the five groups in order. RFC 7919 describes these as estimates, not measured or certified values, so record them as the document's estimates when you cite them. The suggested secret exponent length column gives the minimum private exponent length the RFC suggests for each group: 225, 275, 325, 375 and 400 bits. That figure applies only to peers that choose the short-exponent optimization described in Section 5.2 of RFC 7919. Confirm with your TLS library's documentation whether it uses short exponents before you size private key storage or compare against these values.
The strength and exponent columns are guidance from the RFC, so verify the exact figures in the appendices of the version you deploy and check how your library implements the group before you rely on them for a decision. The sources listed on this page do not say how any particular library selects exponent lengths.
Where Diffie-Hellman public value sizes matter in TLS 1.3
In TLS 1.3, finite-field Diffie-Hellman values are fixed-length on the wire, so the byte length of the prime p drives several parts of the handshake. The cards below cover where that fixed length shows up in messages, validation and key derivation, and what to check when you implement or debug a finite-field group.
Key share extension encoding
The client and server each send a key_share extension that carries their public value for the chosen finite-field group. RFC 8446 requires this value to be a big-endian integer padded on the left with zeros to the size of p in bytes. A ffdhe2048 public value therefore occupies 256 bytes on the wire, even when the integer itself would fit in fewer bytes. Check that your encoder pads the value and does not strip leading zeros, because a short encoding can fail interoperability with peers that expect the full length.
Fixed public key length per group
Because every public key for a given group is padded to the same length, a parser can rely on one fixed size for each group. This matters for buffer allocation and for length checks in handshake parsers: the receiver should reject a key share whose length does not match the size of p for the negotiated group. Mismatched lengths typically surface as handshake failures, so test each finite-field group you enable with peers that send the full padded value.
Shared secret left-padding
The shared secret computed from the exchange is also left-padded with zeros up to the size of the prime. This is easy to get wrong, because many big-integer libraries return the minimal byte form of the result, which can be shorter than p. If the shared secret is hashed into the key schedule without this padding, the derived keys will not match the peer's. Confirm that the implementation pads the secret to the full prime length before key derivation.
RFC 8446 textPeer public value validation
RFC 7919 says peers MUST validate the other side's public value Y by checking that 1 < Y < p-1. An implementation that skips this check may accept a degenerate value that gives a predictable or trivial shared secret. Validation should run after decoding the padded value into an integer, so that a value which is correctly sized but out of range is still rejected. Include out-of-range inputs in your handshake test cases.
RFC 7919 textShort exponent optimization limits
RFC 7919 gives suggested minimum secret exponent sizes for each group, such as at least 225 bits for ffdhe2048. These sizes apply only to peers that choose the short-exponent optimization, as described in Section 5.2. Your implementation should use a full-length exponent unless you have deliberately adopted that optimization, and it should document which choice it makes so that reviewers can check it against the RFC.
RFC 7919 textffdhe2048 through ffdhe8192: figures and where each group is named
The ffdhe2048 group is defined in RFC 7919, Appendix A.1, with a modulus of 2048 bits, a generator g = 2, and the TLS registry value 256. RFC 7919 rates it at an estimated symmetric-equivalent strength of 103 bits and suggests a secret exponent of at least 225 bits. The figures below come directly from that appendix, and the group is the smallest of the five standardized sizes.
- Modulus size: 2048 bits, which sets the length of the prime p and the length of every public value for this group.
- Registry value: 256 in the TLS registry, the identifier a peer sends to select this group.
- Rated strength: an estimated symmetric-equivalent strength of 103 bits, as stated in RFC 7919.
- Suggested secret exponent: at least 225 bits, which applies to peers that use the short-exponent option described in Section 5.2.
- Where it is named: RFC 7919, Appendix A.1, and the TLS and SSH documents that reference the registry values.
Before relying on this group, confirm in the RFC and in your TLS library's documentation that it is enabled and that the registry value it uses matches the one your peers expect.
The ffdhe3072 group is defined in RFC 7919, Appendix A.2, with a modulus of 3072 bits, a generator g = 2, and the TLS registry value 257. RFC 7919 gives it an estimated symmetric-equivalent strength of 125 bits and suggests a secret exponent of at least 275 bits. It sits between the 2048-bit and 4096-bit groups in both modulus size and rated strength.
- Modulus size: 3072 bits, so every public value carried in a handshake is longer than the 2048-bit group's value.
- Registry value: 257, the identifier used to negotiate this group in TLS.
- Rated strength: an estimated symmetric-equivalent strength of 125 bits, as stated in RFC 7919.
- Suggested secret exponent: at least 275 bits, subject to the same short-exponent condition in Section 5.2.
- Where it is named: RFC 7919, Appendix A.2, which the TLS registry references point to.
When you size buffers for this group, use the modulus length in bytes rather than the bit count, and verify the padding behavior in your implementation against RFC 8446, Section 4.2.8.1.
The ffdhe4096 group is defined in RFC 7919, Appendix A.3, with a modulus of 4096 bits, a generator g = 2, and the TLS registry value 258. RFC 7919 rates it at an estimated symmetric-equivalent strength of 150 bits and suggests a secret exponent of at least 325 bits. It is the midpoint of the five groups in the RFC's table of sizes.
- Modulus size: 4096 bits, which doubles the buffer requirement of the 2048-bit group for each public value.
- Registry value: 258 in the TLS registry.
- Rated strength: an estimated symmetric-equivalent strength of 150 bits, as stated in RFC 7919.
- Suggested secret exponent: at least 325 bits, for peers that use the short-exponent option.
- Where it is named: RFC 7919, Appendix A.3.
Check that your peers and intermediaries accept handshake messages of this size, because larger public values increase the bytes each side sends during key exchange.
The two largest groups are ffdhe6144 (Appendix A.4) and ffdhe8192 (Appendix A.5), both with generator g = 2. ffdhe6144 has a 6144-bit modulus, TLS registry value 259, an estimated symmetric-equivalent strength of 175 bits, and a suggested secret exponent of at least 375 bits. ffdhe8192 has an 8192-bit modulus, TLS registry value 260, an estimated symmetric-equivalent strength of 192 bits, and a suggested secret exponent of at least 400 bits.
- Modulus size: 6144 bits for ffdhe6144 and 8192 bits for ffdhe8192, the largest primes in the RFC's set.
- Registry values: 259 for ffdhe6144 and 260 for ffdhe8192.
- Rated strength: 175 bits and 192 bits respectively, as stated in RFC 7919.
- Suggested secret exponent: at least 375 bits and at least 400 bits, subject to the short-exponent condition.
- Where it is named: RFC 7919, Appendices A.4 and A.5.
For both groups, measure the handshake time and message size in a test environment before deployment, since the computational and bandwidth cost grows with modulus size, and confirm the figures with your implementation's documentation.
Several rules apply to all five groups rather than to any one of them. RFC 7919 requires that each peer validate the other side's public value Y by checking that 1 < Y < p-1. In TLS 1.3, the public value is a big-endian integer padded on the left with zeros to the byte length of p, so every public key for a given group has the same length. The shared secret is likewise left-padded with zeros up to the size of the prime, as RFC 8446, Section 7.4.1 specifies.
- Public value check: each peer MUST confirm 1 < Y < p-1 under RFC 7919, Section 5.1.
- Fixed public key length: padding means each group yields a constant-length public value, which simplifies buffer allocation.
- Shared secret padding: the secret is left-padded with zeros to the prime size under RFC 8446, Section 7.4.1.
- Short exponents: the reduced exponent sizes apply only to peers that choose the optimization, per Section 5.2.
- Legacy group note: SSH Oakley Group 2 is a 1024-bit MODP group in RFC 4253, Section 8.1, which is smaller than any group in RFC 7919.
Verify these rules against your TLS library's implementation and the RFC text itself, because a library that omits the public value check or the padding will not interoperate reliably.
How to check the group your TLS or SSH peers actually use
This sequence confirms which Diffie-Hellman group a TLS or SSH connection negotiates, then checks the public value length, validation behavior, and exponent choice against the sizes the RFCs define. The result is a dated record of what your peers do, which you can compare with the sizes in this table.
Identify the negotiated group in the handshake
Capture a handshake with your own test client or server and record the finite-field group the two sides agreed on. For TLS 1.3, the group appears as a named group value in the ClientHello and ServerHello messages, with ffdhe2048, ffdhe3072, ffdhe4096, ffdhe6144 and ffdhe8192 registered as TLS registry values 256 to 260 under RFC 7919. For SSH, the negotiated key exchange method names the group. You know this step is done when you have the group name or registry value written down for each connection you test.
Match the group to its modulus size
Look up the negotiated group in RFC 7919 and note its modulus size in bits: 2048, 3072, 4096, 6144 or 8192 for the ffdhe groups, with generator g = 2. Confirm that the peer is using the group you expect, and flag any connection that falls back to a group the RFCs do not list in this set. You know this step is done when each negotiated group has a recorded modulus size that matches its RFC definition.
Check the public value length against the prime
In TLS 1.3, the finite-field public value is a big-endian integer left-padded with zeros to the size of p in bytes, so every public key for a given group has the same length. Divide the modulus size in bits by eight to get the expected byte count, then compare the length of the captured public value. A mismatch, or a value shorter than expected, means the peer is not padding as RFC 8446 requires. You know this step is done when the captured length equals the modulus size in bytes for every connection.
Confirm the peer validates the public value
RFC 7919 requires each peer to validate the other side's public value Y by checking that 1 < Y < p-1 before using it. Test this with your own peer by sending a value outside that range and observing whether the connection is rejected. Because validation behavior is a property of the implementation, record the product and version you tested, since the sources listed on this page do not cover every implementation. You know this step is done when out-of-range values are refused and the result is recorded against a named version.
Check whether the short-exponent option is in use
RFC 7919 gives suggested secret exponent sizes for each group, for example at least 225 bits for ffdhe2048 and at least 400 bits for ffdhe8192. These short-exponent sizes apply only to peers that choose the short-exponent optimization, described in RFC 7919 Section 5.2. Check the peer's configuration or its documentation to find out whether that option is enabled, and note the exponent length it uses. You know this step is done when each tested peer has a recorded answer on whether the optimization is on and, if so, which exponent length applies.
Flag SSH group 2 as a smaller legacy group
SSH Diffie-Hellman Oakley Group 2 is a 1024-bit MODP group listed in RFC 4253. It is smaller than every ffdhe group in RFC 7919, which start at 2048 bits, so any SSH connection that negotiates group 2 has a modulus size well below the ffdhe sizes in this table. Check whether your SSH server or client still offers group 2 in its key exchange list, and note whether it can be removed from your configuration. You know this step is done when each SSH endpoint has a recorded answer on whether group 2 is offered or negotiated.
Test the server or client in your own environment
Repeat the earlier checks against the server or client you actually run, using a test instance in an environment you control. Record the software name, version, configuration and the outcome of each check, so the results can be compared later and rerun after an upgrade. Use your own vendor's documentation to confirm how the product selects groups and handles exponents. You know this step is done when you have a dated record for each server and client in scope, covering the negotiated group, public value length, validation result, exponent setting and SSH group 2 status.
What these figures do not tell you
The strength values in this table are estimates. RFC 7919 rates ffdhe2048 at 103 bits, ffdhe3072 at 125 bits, ffdhe4096 at 150 bits, ffdhe6144 at 175 bits and ffdhe8192 at 192 bits, each expressed as a symmetric-equivalent strength. These are the figures the RFC gives, not measured results, and they describe the group parameters only. They do not describe your deployment's configuration, the peer you negotiate with, or the attacks that matter to your threat model. Before you use a rating in a risk assessment or a vendor questionnaire, cite it as the RFC's estimate and confirm the current guidance for your sector with the relevant standards body.
The short exponent sizes listed in the appendices, such as at least 225 bits for ffdhe2048, apply only to peers that choose the short-exponent optimization described in RFC 7919, Section 5.2. They are not a universal minimum for every connection. If your implementation generates a full-length exponent, or if the peer does not use the optimization, the exponent sizes in this table do not apply to that exchange. Check which option your TLS library and your peers use, and confirm the exact behavior in the library's own documentation before you size anything around these numbers.
The padding rules in this section are protocol-specific. RFC 8446, Section 4.2.8.1 and Section 7.4.1 define zero-padding for the finite-field public value and the shared secret in TLS 1.3 only. Other protocols, including SSH, which uses a different group (the 1024-bit Oakley Group 2 in RFC 4253, Section 8.1), handle encodings on their own terms. This page does not cover wire encodings, byte-order handling, or differences between implementations. Confirm those details in the RFCs themselves and in your implementation's documentation, and test interoperability against each peer you need to support.
Common questions about Diffie-Hellman group and key sizes
How large is an ffdhe2048 public value?
An ffdhe2048 public value is 2048 bits, which is 256 bytes, because the group's modulus p is 2048 bits long and the public value is padded to the size of p. RFC 7919 defines ffdhe2048 with a 2048-bit modulus and the TLS registry value 256. In TLS 1.3, the public value is a big-endian integer left-padded with zeros to the size of p in bytes (RFC 8446, Section 4.2.8.1), so the byte length is fixed for the group rather than varying with the value. Buffer sizes in your TLS stack should allow for 256 bytes per public value on this group. Confirm the exact encoding your library uses in its documentation before setting fixed buffer sizes.
Which Diffie-Hellman group is rated at 192 bits of strength?
The ffdhe8192 group is rated at an estimated symmetric-equivalent strength of 192 bits. RFC 7919 (Appendix A.5) gives it an 8192-bit modulus, the TLS registry value 260, and a suggested secret exponent of at least 400 bits. The rating is an estimate from RFC 7919, and it is the rating the RFC assigns to the group, not a guarantee of security in a particular deployment. Peers that use the short-exponent optimization must check RFC 7919, Section 5.2, which limits that option to peers that choose it. Compare your group choice against the ratings in RFC 7919 alongside the strength requirements in your own policy.
Why does every public key for a group have the same length?
Every public key for a given group has the same length because the public value is padded on the left with zeros to the size of the prime p in bytes. RFC 8446 (Section 4.2.8.1) specifies this padding for TLS 1.3, so a value that would otherwise be shorter is still sent at the full width of the group. Fixed-width encoding keeps message parsing simple and avoids leaking information through length differences. The same rule applies to the shared secret, which RFC 8446 (Section 7.4.1) left-pads with zeros up to the size of the prime. When you parse these values, expect the full group width every time rather than trimming leading zeros.
What are the TLS registry values for the ffdhe groups?
The TLS registry values for the five ffdhe groups in RFC 7919 are 256 for ffdhe2048, 257 for ffdhe3072, 258 for ffdhe4096, 259 for ffdhe6144 and 260 for ffdhe8192. Each value identifies a group in the TLS supported groups negotiation, so a server and client use them to agree on the same modulus. The registry values appear in the group sizes list of RFC 7919, which also gives the modulus size in bits and the generator g = 2 for each group. When you configure or audit a TLS endpoint, check that the group identifiers it advertises match these values, and confirm the exact list your TLS library supports in its documentation.
How does SSH Diffie-Hellman group 2 compare with the ffdhe groups?
SSH Diffie-Hellman Oakley Group 2 is a 1024-bit MODP group defined in RFC 4253 (Section 8.1), which is half the modulus size of ffdhe2048. The ffdhe groups in RFC 7919 start at 2048 bits, so the SSH group 2 modulus is smaller than the smallest ffdhe group. The two protocols define their groups separately, and their sizes, identifiers and negotiation rules are not the same. Compare the two by modulus size in bits, not by name, and confirm which groups your SSH server and client actually offer. The RFCs listed on this page do not compare the two groups' rated strengths directly, so check any strength claim against the source that makes it.
Where should I check a peer's public value before using it?
Check that the other side's public value Y satisfies 1 < Y < p-1 before you use it, as RFC 7919 (Section 5.1) requires peers to validate it. This check rejects values that would produce weak or degenerate shared secrets. Run it on every received public value, and reject the handshake when the check fails rather than continuing with the value. The check is simple to implement, but it is easy to skip when a library exposes the raw exchange, so confirm that your implementation performs it. Look for this validation in your TLS or SSH library's documentation and in its test suite.
What is the secret exponent size for ffdhe3072?
RFC 7919 (Appendix A.2) suggests a secret exponent of at least 275 bits for ffdhe3072, and gives the group an estimated symmetric-equivalent strength of 125 bits. The ffdhe3072 group uses a 3072-bit modulus and the TLS registry value 257. The 275-bit figure is a minimum suggested by the RFC, and the short exponent sizes it lists apply only to peers that choose the short-exponent optimization described in RFC 7919, Section 5.2. If your deployment uses that optimization, confirm the exponent length with your library's settings and the RFC text before relying on it.
How DeployOpen works on Diffie-Hellman group configuration
DeployOpen starts by mapping where finite-field Diffie-Hellman groups are negotiated in your environment, including TLS and SSH endpoints, then agrees on target groups and exponent sizes in writing. We implement and test those settings in your own infrastructure and hand over the configuration, test evidence and documentation your teams need to review.
How we scope
- We inventory the TLS and SSH endpoints that negotiate finite-field Diffie-Hellman groups in your infrastructure.
- We agree in writing which RFC 7919 groups, such as ffdhe2048 or ffdhe3072, each system will support and why.
- Engagements are fixed-scope, so deliverables and timelines are confirmed before any configuration work begins.
How we build
- We configure each endpoint to offer only the agreed named groups and remove weaker legacy Diffie-Hellman options.
- We set secret exponent sizes where the agreed design uses the short-exponent optimization described in RFC 7919.
- We test peer validation of public values and confirm handshakes complete against each client population you run.
How we hand over
- You receive the final group and exponent configuration for each system, with the settings and file locations recorded.
- You receive test results showing which groups were negotiated, with the client versions used during testing.
- You receive documentation written for your security and compliance teams to review and check against their own standards.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer after the initial handover.
- Retainers can cover re-testing when client libraries, operating systems or TLS and SSH stacks are upgraded.
- Confirm with your vendors which group and exponent options each product version supports before you rely on them.

