News for hackers. Stuff that matters.
Re:Git Files Hidden in Plain Sight by whirlwin on Tuesday August 01, 2023 @02:09AM (#36952876)
Why does it need to be public? By revealing your public key you also reveal the algo used for your public/private keypair. If you are a renowned developer and have an insecure algo, you might be a victim for targeted attacks
Re:Git Files Hidden in Plain Sight by woodruffw on Tuesday August 01, 2023 @02:18AM (#36952930)
If your goal is to have others verify your signatures, then they need to have your public key.

The solution to using weak algorithms is to not use them, not to hide your public key. If you don’t reveal your public key, then there’s effectively no value in the signatures made by its private half.

Re:Git Files Hidden in Plain Sight by whirlwin on Tuesday August 01, 2023 @03:52AM (#36953509)
Isn't the best way to verify the integrity to use git signed commits? GitHub has great support for this
Re:Git Files Hidden in Plain Sight by woodruffw on Tuesday August 01, 2023 @08:41AM (#36955231)
You’re mixing up integrity and authenticity: git provides integrity through its basic design; commit signing additionally adds authenticity (sort of).

But again: you don’t actually get authenticity if you obtain the public key from the same untrusted channel as the signed material. The key has to come from another channel (another simplification, but true in PGP and git’s case). That channel can be the user’s GitHub profile, website, etc., but it can’t be the repository itself.

Re:Git Files Hidden in Plain Sight by lloeki on Tuesday August 01, 2023 @04:06AM (#36953582)
Fun fact, just as SSH public keys for a user are readily publicly available on GitHub, gpg keys are as well

    curl https://github.com/${username}.keys
    curl https://github.com/${username}.gpg | gpg --list-packets
Interestingly enough, since changing the GH keys is subject to GH authentication (possibly involving 2FA), the owner's key is kind of validated (by GH) so it _kind of_ makes GH a gpg key notary.

Having `git log --show-signatures` validate _all_ signatures is then a matter of:

    curl https://github.com/${username}.gpg | gpg --import
Now I kind of wish GH would sign such user pub keys _at the time they're added_ (thus at the time GH authentication is deemed valid), thus ensuring they've not been tampered with in between.

With a bit of UI GH could present a UI for a user to validate another user's key, and sign that assertion (with a GH private key, not the user's of course) as well.

Of course it hinges on trusting GH, but GH already signs e.g UI borne merge commits on your behalf so there's that.

Then next step would be for GH to host an actual key server to accept off-band signed keys containing a magic comment that bind the keys and sigs to GH usernames...

Re:Git Files Hidden in Plain Sight by lvc_ on Tuesday August 01, 2023 @02:30AM (#36953001)
It doesn't necessarily need to be public in the global sense, but it is public in the sense of "you can't rely on keeping it secret as a security boundary". Since its used to validate the signature, it will usually need to be (at least) as public as the signed thing.
Re:Git Files Hidden in Plain Sight by pdpi on Tuesday August 01, 2023 @05:35AM (#36954126)
Public key cryptography is pretty pointless if you don’t take advantage of the public part. One, you can’t send me any encrypted messages without my public key. Two, you can’t verify my signatures without my public key.

Insecure algorithms are a red herring here too. Either I know what algo you used and can interact with you, or I don’t.

Re:Git Files Hidden in Plain Sight by upofadown on Tuesday August 01, 2023 @08:28AM (#36955132)
>If you are a renowned developer and have an insecure algo, ...

Example of such an insecure algorithm that might be relevant here?

Re:Git Files Hidden in Plain Sight by WorldMaker on Tuesday August 01, 2023 @11:14AM (#36957038)
Low key sizes (<= 1024) of RSA are considered vulnerable, especially to quantum computer attacks. Some ECC curves are considered vulnerable, especially to NSA backdoors.