118 points · by illuminated · 5y ago · 37 comments
How is the key material established, exactly? How is it rotated? How is it protected when stored? The answers to these questions are a lot more relevant to understanding the security of this application than citing which encryption mode is being used.
Yeah, AFAIK there isn't really much difference between AES-GCM and any other AES + HMAC algorithm (eg. AES-SHA1) other than that AES-GCM is more performant. In this sort of use case, that's not really relevant, so it's strange to advertise it like it's some sort of feature.
GCM is both an authentication method and encryption mode. The big benefit is its all specified as one primitive because combining primitives is where people often screw up.
HMAC-SHA1 is an authentication mechanism, there's various ways you can combine it with something like AES-CTR or AES-CBC to make something secure, but also plenty of ways to screw it up. Saying something like AES-SHA1 is meaningless because there's no standard way to combine those two, so you dont know what the person is doing, and you still dont know what the mode is.
But none of these widely used and well-standardized protocols require an authenticated encryption mode even though they all have both authentication and encryption as security properties. Authenticated encryption doesn't give you anything other than performance over the standard encrypt + tag approach (which is still widely used).
And AES-GCM has some drawbacks that encrypt + tag do not (although the performance gains usually trump the drawbacks).
https://github.com/cs01/termpair/blob/1d273fa306a543fefbf2cf...
AES-GCM has a relatively short IV (= nonce): only 96 bits (12 bytes). To make things worse, if an IV ever gets repeated GCM fails catastrophically[1]. The design document[2] explicitly point out that a FIPS 140-2 compliant GCM hardware[3], must take all possible precaution to ensure an IV never gets repeated, even if the device suffers a critical power loss.
The safe way to use AES-GCM in software (for instance, the way it is used in TLS) is to just use a running counter and replace the key before the counter overflows and starts repeating itself. Random counters bad, since if enough messages are generated with the same key the chance of a message that repeats an IV under the same key increases. The statistic phenomenon behind the chance of something like that being repeated is called the "Birthday Problem"[4], so exploiting this kind of weakness is often referred to as a "Birthday Attack"[5].
tl;dr: If you want an easy life, just never use any form of AES at all. Most AES mode can be completely safe if used and implemented with care - but it is generally quite hard to do that. AES has too many knobs and there is too much bad advice on places like Stack Overflow and various blogs.
Generally, for encrypting multiple messages with the same key, the solid advice is to use NaCl secretbox (XSalsa20-Ply1305) or libsodium aead_xchacha20poly1305_ietf[6].
But you probably need more than that when encrypting potentially long-lived bidirectional streams of data.
---
[1]: It fails even worse than other authenticated counter mode ciphers due to the design of the GHASH function:
https://csrc.nist.gov/csrc/media/projects/block-cipher-techn...
[2]: See section 9 here in NIST 800-38D: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpubli...
[3] Keep in mind that like most 2000s vintage cipher specs, GCM was designed as a hardware cipher. Software was more or less an afterthought, if anything at all.
[4]: https://en.wikipedia.org/wiki/Birthday_problem
[5]: https://en.wikipedia.org/wiki/Birthday_attack
[6]: https://libsodium.gitbook.io/doc/secret-key_cryptography/aea...
refs: [0]https://tmate.io
It's great for tech support.
tty-share is also good https://tty-share.com/
At a quick glance this is not seem to be end to end encrypted, but tmux is running on their server? That's not something I could ever use for work, we are in regulated domain. But you can run your own server, need to check that out.
https://duckly.com/tools/terminal
Unfortunately not self-hosted.
We briefly tried tmate - do yourself a favour and get the upstream build (available as static binaries for Linux) - it's a bit finky about versions.
Eg via: https://github.com/tmate-io/tmate/releases/tag/2.4.0 get https://github.com/tmate-io/tmate/releases/download/2.4.0/tm... and drop the extracted binary in ~/bin or something.
You can self-hosted tmate, but imnho tmate doesn't add that much value over "grant user ssh access and use plain shared tmux/screen".
In that case, you might (for workstation/laptop) have co-worker's on vpn via wireguard /tailscale, bind sshd to the vpn interface, and allow access via ssh keys/certificates.
The irony is that 20 years ago video conferencing was unthinkable, but I used VNC over a dial-up modem. Lossless and much better for terminal sharing than what is generally available today.
Modern computing feels like the dark Middle Ages after the downfall of the Roman empire in some aspects...
It also allows to do selected ssh tunnels, useful to share services on local ports.
https://www.endpoint.com/blog/2009/09/24/gnu-screen-follow-l...
https://linux.die.net/man/1/kibitz
https://opensource.apple.com/source/tcl/tcl-20/tcl_ext/expec...
Not bad for 415 lines of code.
Compared to vscode: when sharing the terminal, you don't need to worry about following the other person's cursor or them following yours, as there is only one cursor.
You don't need to worry about telling them what dukes you are opening, as there is only one editor.
You also don't need to worry about registering for an account, as (at least with tmate) it's simply an ssh connection for the remote person.
It is the only way I've found that allows for effective remote pairing. There are a number of downsides, but it is a wonderful tool.