DEV Community

Cover image for 2.43x bigger keys: OpenSSH's new P-384 default
frank chu
frank chu

Posted on

2.43x bigger keys: OpenSSH's new P-384 default

A P-384 public key file is 211 bytes where an Ed25519 one is 87 — 2.43x bigger, measured on my machine. That is the visible cost of OpenSSH's December 3 commit switching the default key type ssh-keygen generates from Ed25519 to ECDSA NIST P-384.

The commit itself is two constants in ssh-keygen.c:

-#define DEFAULT_KEY_TYPE_NAME "ed25519"
+#define DEFAULT_KEY_TYPE_NAME "ecdsa"
-#define DEFAULT_BITS_ECDSA 256
+#define DEFAULT_BITS_ECDSA 384
Enter fullscreen mode Exit fullscreen mode

That second line matters too: anyone running ssh-keygen -t ecdsa without -b also moves, from P-256 to P-384. And a bare ssh-keygen now proposes ~/.ssh/id_ecdsa instead of ~/.ssh/id_ed25519, which is the kind of change that breaks provisioning scripts that assume the old filename exists after a successful exit code.

This is in -current, not on your server yet

The change landed in OpenBSD -current on December 3 and is mirrored in openssh-portable. It reaches users with a future release, not today. I checked the OpenSSH on this machine — 9.6p1 on Ubuntu — and a bare ssh-keygen still produces a 256-bit ED25519 key. Existing Ed25519 keys keep working and servers keep accepting them; nothing here rotates or invalidates anything you already have.

Two neighboring commits complete the picture. On December 3–4, the default signature preference order was rearranged to put the post-quantum hybrid ssh-mldsa44-ed25519 first, ecdsa-sha2-nistp384 second, and plain ssh-ed25519 third. Then initial support for composite ML-DSA-87/ECDSA P-384 signatures (ssh-mldsa87-p384) landed, with the commit message explicitly saying "Not yet enabled by default."

So the ordering tells a story the key-type commit alone does not: the hybrid is the destination, P-384 is the classical stopgap ranked above Ed25519, and the composite that pairs ML-DSA-87 with P-384 is being built but not switched on.

What the stopgap costs, measured

I generated both key types with the local ssh-keygen and ran 100 sign and 100 verify operations per type on a small file, taking medians. These are whole-process times, so process startup is included in every number — treat them as the cost you actually pay per invocation, not pure cryptography.

Measure Ed25519 ECDSA P-384 Ratio
Public key file 87 bytes 211 bytes 2.43x
Private key file 387 bytes 602 bytes 1.56x
Signature file 294 bytes 476 bytes 1.62x
Sign, median of 100 5.48 ms 9.78 ms 1.78x
Verify, median of 100 7.80 ms 8.09 ms 1.04x

For interactive SSH this is noise — a few extra milliseconds and a few hundred bytes disappear next to network latency. It only starts to matter at very high connection rates or on constrained hardware, and even there the honest answer is to measure your own workload rather than trust my process-spawn numbers.

What nobody has said

The commit message gives no reason: "switch default key type generated to ECDSA NISTP384; ok markus@". The timing — one day after the NSA/CISA/ONCD statement urging an immediate transition to post-quantum cryptography — is suggestive, and OpenBSD Journal framed the changes as happening "in the shadow of recent announcements" about PQ urgency. But neither OpenSSH nor the agencies have said Ed25519 or 256-bit curves are broken, and I am not going to claim a causation the sources do not state.

What is safe to say: P-384 is not post-quantum. Like Ed25519, it falls to a large enough quantum computer. The new default buys classical headroom and compatibility — P-384 is accepted by essentially every SSH implementation still in service — while the ML-DSA hybrids that actually address the quantum problem require recent OpenSSH on both ends.

My take: pin your key type explicitly in automation now (-t ed25519 if you want to stay, -t ecdsa -b 384 if you want the new default early), because the one guaranteed breakage here is scripts that assumed a bare ssh-keygen would always mean the same file. The cryptography debate will take care of itself; the filename will not.

Sources:

Top comments (2)

Collapse
 
userxnom profile image
Abdullah Naseer •

Frank, the number that reframes this for me is not the 2.43x on the public key — it is the 1.04x on verify. Signing got 1.78x slower (5.48 to 9.78 ms) while verify barely moved (7.80 to 8.09 ms), so the real cost lands on the machine generating keys and signing, not on the servers verifying them. That flips where I would worry about it: fleet provisioning and CI runners that sign a lot, not the SSH servers themselves. The detail I would add to your pin-it-now advice is to grep for the filename assumption in the other direction too: anything that hard-codes ~/.ssh/id_ed25519 as "the key exists" will now silently find nothing, since a bare ssh-keygen writes id_ecdsa instead. One question your ordering section left me with: with ssh-mldsa44-ed25519 first in the preference order but ssh-mldsa87-p384 "not yet enabled by default," is P-384 the bridge to the hybrid, or the thing the hybrid eventually replaces — and would you pin -t ed25519 today, or jump straight to the hybrid once it flips on?

Collapse
 
smtahosin profile image
S M Tahosin •

Frank lol 12:08am, fresh box, cat id_ed25519.pub and... empty authorized_keys. empty!! file wasn't there, my script never checked, it just trusted the name xD pinning -t ed25519 in the script today before it bites me again. thanks for the table :)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.