6 ms·
Ah, if only this was a thing a decade or two ago. IMO, the way GPG was done killed what could have been a decent ecosystem. It's a combination of two factors:
by dale_glass 3y ago
Ah, if only this was a thing a decade or two ago.
IMO, the way GPG was done killed what could have been a decent ecosystem. It's a combination of two factors:
1. Don't roll your own crypto.
2. The available code (gpg) is a colossal pain to use.
So for instance, how does something like KMail deal with gpg? There's no libgpg originally. There's just the gpg tool, so you've got to call it as a sub-process, and it really sucks:
1. You have to deal with process management, multiple filehandles, text parsing, non-trivial interactions, etc.
2. It's slow. You pay startup costs every single time. This is a huge problem on something interactive like a mail client, and it's dependent on things like the amount of keys in the gpg store.
3. gpg has very specific ideas about how it wants to be used, and not everything fits.
Say that you oh, want to do some stats on GPG keys. There's no libgpg to just read an .asc file and get the list of signatures from that, no. You have to call gpg, feed it the key, parse the result. For some things you might actually have to have gpg import the key first. Manage a fake home dir for GPG. Deal with the horrible performance as the keystore grows. A million keys at a gpg invocation per second is going to be around 2 weeks.
Unfortunately it's only now that gpg is effectively dead that the problem started to get fixed.
Also, at this point GPG is effectively a legacy technology anyway. Modern cryptographic thought considers GPG to be a terrible idea for a whole bunch of reasons that are deeply built into it, so the only solution for that is throwing it out.
- wiktor-k 3y agoI agree that gpg did not age well. If we compare it to a different project with similar history: curl, it's apparent that gpg chose wrong on several fronts. It should be a library first instead of a cli tool. Funny part is that even the library of gpg (gpgme) is internally calling the binary. I've played around with designing a higher level library to OpenPGP once (https://pypi.org/project/pysequoia/ https://pypi.org/project/pysequoia/) and personally I think it yields more readable, faster and secure code.
- im3w1l 3y ago> Funny part is that even the library of gpg (gpgme) is internally calling the binary. Sounds like a great way to transition things in a saner direction. You know it will be bug-for-bug compatible with calling the gpg-binary. Having one blessed text-parser with a lot of eyes on it is much better than everyone rolling their own. Getting people used to depending on a library instead of shelling out also means it becomes possible to move the library to independent implementations.
- ognarb 3y agoDisclaimer: I work on GPG and I am one of the KMail core developer. The standard way to use GPG is via the gpgme librairie which then communicate with the Assuan protocol to the gpg deamon. Gpgme has official bindings to C++, Qt and python. In KMail we use the Qt bindings and it works fine.
- dale_glass 3y ago> Disclaimer: I work on GPG and I am one of the KMail core developer. Nice work :) Looking forward to seeing further improvements to it, it's still got a few rough edges, but otherwise I really like it. > The standard way to use GPG is via the gpgme librairie which then communicate with the Assuan protocol to the gpg deamon. Yeah, but all GPGme does is calling the gpg binary and presenting a more palatable interface to applications. That solves the problem as far as the API goes, but performance is still terrible for some uses, and it's still liable to run into all kinds of weird problems in edge cases. But at least for something like mail clients it seems to work well enough.
- curt15 3y agoDoesn't git use GPG to sign commits?
- dale_glass 3y agoYes, why? And I believe these days you can use SSH keys for signing commits as well.
- Zizizizz 3y agoYou can use SSH keys as well.
- dheera 3y agoJust use an ssh key for authentication and there is no need to sign commits.
- rmwaite 3y agoHow does SSH authentication provide the same guarantees as signing commits?
- dheera 3y agossh itself is cryptographically secure. the ciphertext of the commit being pushed is as good as a signature
- defanor 3y agoI guess you are considering the case where a single signer transfers commits over SSH to a single verifier, with both putting the same meaning into the act of transfer as people normally would into a signature. But git is a distributed VCS, with signatures handling many more scenarios: consider multiple committers and multiple signatures, transfer over multiple, different, untrusted channels, multiple verifiers.
- deleted 3y ago[deleted]
- Lammy 3y ago> Don't roll your own crypto. This is exactly the meme I would try to propagate if I had backdoored every popular crypto implementation. More people should roll their own crypto so they can stumble and learn and eventually get good at it.
- woodruffw 3y agoThis assumes that implementation diversity stymies an attacker, which isn't really true in cryptography. Cryptographic errors have well-understood "shapes," frequently present even when the raw algebra of the implementation is correct; adversaries are delighted when they discover yet another hand-rolled RSA implementation that's susceptible to BB'98 or BB'06.
- LoganDark 3y agohttps://en.wikipedia.org/wiki/Daniel_Bleichenbacher https://en.wikipedia.org/wiki/Daniel_Bleichenbacher
- YoshiRulz 3y ago> More people should roll their own crypto so they can stumble and learn and eventually get good at it. This would only work if it were always obvious when your implementation is unsecure, which is not the case.
- tptacek 3y agoSeems like a great way to get new brain surgeons, too!
- aborsy 3y agoRolling your own crypto is obviously a bad idea. It turned out the cryptography implemented by developers not expert in cryptography sometimes was merely obfuscation. If you want to roll your crypto, become a cryptographer first. That sounds circular, but isn’t.
- deleted 3y ago[deleted]
- fanf2 3y ago4. the gpg-agent suffers from race conditions that make it unreliable