How to find and upgrade SSH and PGP keys using P‑256, ED25519, and Curve25519

sethmlarson.dev
lumpa
3 hours ago
108points
45 comments

Comments

ggm•3 minutes ago
Maybe THIS will make vlc for android update its algorithms because right now, you cannot login from vlc on android over sftp to any modern OS without a significant downgrade on the receiving host.
quantummagic•3 hours ago
The advice to use ssh-agent is only going to list currently loaded keys; better to just scan manually:

       find ~/.ssh -type f -name "*.pub" -exec ssh-keygen -lf {} \;
regecks•3 hours ago
There are a bunch of iOS terminal apps + other hardware keys where the SSH keys are generated on the "Secure Enclave", but P-256 is the only key type supported.

Should we be moving off these as well?

samhclark•2 hours ago
fwiw, you can get a P-384 key on the Secure Enclave on macOS today using `sc_auth` but you'll need to (ask your favorite agent to) write a little custom ssh-agent for that key, to expose it as a plain `ecdsa-sha1-nistp384` key instead of the `sk-*` variant. Just did that myself today, worked fine. It's like 200 lines of Swift.

But also, I don't think that's extremely urgent at a personal level. It seems like this still require being targeted and a lot of effort to crack a key.

rolosa•1 hour ago
I hope termius upgrades it. They support the PQC keys but not in the secure enclave. I hope it's not a hardware limitation
stackghost•37 minutes ago
Depends on the device, I think. I have an iPhone 17 and the secure enclave supports ML-KEM and ML-DSA (kyber/dilithium) operations.
drum55•3 hours ago
Doesn’t really matter where they are if they’re vulnerable, but we don’t really know how vulnerable. If the security is brought down to 90 bits does that matter for most things? Probably not, at least in the medium term. Bitcoin's entire proof of work is in the order of 90 bits, for over 15 years of compute time on dedicated hardware.
sscarduzio•3 hours ago
We need time for tooling to catch up before we can move to heavier cryptography.

Also, many web apps using JWT tokens embedded in cookies will hit the 8K max header length just because of the humongous signatures

dannyw•1 hour ago
FN-DSA / FIPS 206 is still in draft status, and not a cryptographer, but seems promising for more practical PQC without absurd key sizes.

For now, and for my personal security model, I am simply increasing key sizes.

lousken•3 hours ago
Why would you upgrade from ed25519 ssh key? It is not used in encryption but for auth

For auth they are perfectly fine - it's like saying 17 character passwords are no longer good enough...

dist-epoch•2 hours ago
A MITM intercepting your public ssh key can then authenticate as you if the curve is broken
what•just now
You don’t need a MITM. Your public key is PUBLIC. All the public keys for every GitHub user viewable, and not by accident.
wolvoleo•2 hours ago
Yes true but in order to do that they first need to get to the point of being able to MITM and then break the server key to be able to identify as it.

I don't really see that happening on my stuff which is a very low value target.

manbash•32 minutes ago
If it's low value to you, then sure don't bother about encrypting your traffic.
wolvoleo•3 hours ago
Yes, as the attacker normally won't have the public part of the key pair, they have nothing to crack.

I would stop publishing them on eg GitHub etc but I've never done that anyway.

sva_•2 hours ago
Hope you don't use ssh-agent (I don't)
noodletheworld•2 hours ago
It depends; you don't reuse ssh keys right? That would be lazy and bad.

If you did for example, use the same key for github and login, anyone could access your public keys on this unauthenticated url:

https://github.com/yourname.keys

nixosbestos•2 hours ago
I have a hard time seeing this sub-thread conversation as viable or worth anyone's time. If some people think hiding a pubkey is their salvation out of this, I don't see any point in engaging.
wolvoleo•2 hours ago
I don't use github at all. And not much cloud. I'm not a dev, I only use my keys on my own servers.
drum55•2 hours ago
Github has always published all keys for all users though, it's the source of some really stupid vulnerabilities that they seem to think "public key" means "should be public".
dunham•2 hours ago
"tangled.org" also publishes public keys in ATProto (that might be necessary to coordinate with storage servers). I've dropped my p256 key. It's not yet clear to me if ed25519 has be weakened or not.
ninkendo•2 hours ago
Please elaborate. What vulnerabilities?
drum55•2 hours ago
You can discover what SSH servers are owned by what people by abusing GitHub. They publish the public keys, you have a target SSH server and you send the hashes of the keys you scraped to the server, it tells you which GitHub user has access there. Reverse way, you have a targets keys and you send them to every SSH server on IPv4, and it tells you what servers they own. This is because SSH supports just telling you if a hash of a public key would give you access to an account, meaning you don't need to enter the password for all keys in ~/.ssh sequentially for every server.
mscdex•1 hour ago
As an SSH server, there's nothing stopping you from always rejecting (or always allowing) those public key checks and only doing any work when sent the full public key authentication request (with the signature).
drum55•1 hour ago
The software doesn’t do that now though, at least openssh doesn’t. It would break a lot of people’s setups to change that assumption out of the blue.
mscdex•42 minutes ago
If you accepted all public key checks it shouldn't break anything. It's just an optimization for the client as the server needs to handle full public key authentication requests anyway.

Besides, there are additional (server-side) safeguards to prevent someone from doing these sorts of mass public key checks using anyone's public key, including (but not limited to) IP whitelisting and port knocking.

cortesoft•1 hour ago
Ideally, you should be using a unique key for every service.
drum55•1 hour ago
Yes you should, it's a little fiddly because SSH supports a maximum of 11 keys before you need to manually define them for each connection.

It's an another attack vector too though, if you SSH to my server you send me all of your public keys in ~/.ssh by default (or at least the hashes of them), and I can compare them to GitHub to find out your real identify. Github is just making this trivial by needlessly exposing them.

novafunc•17 minutes ago
I made a script that accidentally solves that problem.

The script can change the active identity file by commenting out all the other ones listed. I also have multiple git config files, and it creates a symlink to the active version. And it does all that without me having to restart my terminal session or anything weird, just instant.

It's nice because it lets me separate my personal identity and dumb username identity. And it could be used to use different keys for different services.

prmoustache•2 hours ago
The article is misleading. you can't upgrade a pgp/ssh key. You create new ones and retire old ones.
wpollock•2 hours ago
Don't forget about the server's keys! For OpenSSH, look for keys in "/etc/ssh" or "C:\ProgramData\ssh".
debayande•3 hours ago
> Seems that my PGP key is using RSA-4096 which is not a concern for today.

Am I reading this wrong, or is the author's example showing an Ed25519 key?

SethMLarson•2 hours ago
That's an SSH key! My PGP key returned no hits, but I can see why that section is confusing. I'll fix that to be clearer :)
debayande•2 hours ago
That's a miss on my part as well! Apologies.
SethMLarson•2 hours ago
Just pushed a fix, thanks for raising that issue. I think it's much clearer now :)
zygentoma•1 hour ago
> "ECDSA-SK, Ed25519 and Ed25519-SK keys have a fixed length and the -b flag will be ignored."

WTF?!?

Why would this be ignored instead of failing the command?

imrehg•36 minutes ago
> This is ~100 days (a very short timespan for anything that affects "all CAs") and would affect ~25% of all web traffic, *which is not something one would do for no reason.*

Emphasis at the end is mine: that is true, however we live in the timeline where the obvious reason is way too often not the real reason. So giving the benefit of the doubt to people requiring others to do a bunch amount of heavy lifting, based on unknown motivations, is getting old very quickly...

I'm not at all saying that this cannot be a good reason. Just that "this is hard for many, so they must mean it" doesn't pass the current climate's sniff test (for me).