4 ms·
Really, all I did here was combine posts from Matthew Green, Filippo Valsorda, and George Tankersley into one post, and then talk to my partner LVH about it. So
by tptacek 7y ago
Really, all I did here was combine posts from Matthew Green, Filippo Valsorda, and George Tankersley into one post, and then talk to my partner LVH about it. So blame them.
(also 'pvg, who said i should write this, and it's been nagging at me ever since)
- bellinom 7y agoI've followed and enjoyed your commentary on PGP and cryptography in general, so I thought I'd post it. Any idea when Fillipo's `age` will be done, or how to follow its development, other than the Google doc?
- tptacek 7y agoFilippo should get to work! The design part of age is the hard part; the actual programming is, I think? maybe one of the easier problems in cryptography (encrypt a single file with modern primitives). I am a little bit giving Filippo shit here but one concern I have about talking "age" up is that I'm at the same time talking the problem of encrypting a file up more than it needs to be, so that people have the impression we'd have to wait, like, 5 years to finally see something do what operating systems should have been doing themselves all this time.
- DuskStar 7y agoWhat are your thoughts on Keybase as a secure Slack replacement?
- corin_ 7y agoPersonally, I love Keybase and it is my #1 choice for communicating with a few people, but bugs are far too frequent for me to consider it for a business. It's getting better, but not close being business ready imo.
- lucb1e 7y agoI've been using Wire on iOS, web, desktop (electron), and Android, and Keybase on Android and desktop (cli). Both are not great but Keybase is definitely the more buggy. Wire on Android, on the other hand, is also quite unusable due to its battery drainage. And both are pretty much unusable on desktop: Keybase is a CLI (not even a TUI) and Wire is Electron. I'd prefer a TUI over Electron but it's not even a TUI, so I guess Wire wins this round. Keybase also doesn't have a web client, which is why I have experience with the command line client. I think that says enough in and of itself. What I'm trying to say is, definitely also try Wire as it's similar but slightly better. I also haven't figured out how to verify someone over Keybase, so it's basically unauthenticated or opportunistic encryption. By comparison, Wire is considered secure enough by my company after doing a pentest on it, which says quite something (most customer's stuff we would run from if we were thinking of using it), and we use it as our main communication platform within the company.
- DuskStar 7y ago> Keybase is a CLI Keybase has a relatively functional electron app on Mac and PC that I've used, and presumably also Linux. > I also haven't figured out how to verify someone over Keybase Isn't the goal with Keybase to see "this person is accountiknow on Github" and do verification that way?
- lucb1e 7y ago> Keybase has a relatively functional electron app Oh, then I am mistaken, thank you for correcting me and sorry for talking nonsense. > Isn't the goal with Keybase to see "this person is accountiknow on Github" and do verification that way? Yes, but that doesn't help me because my chat account is not cryptographically tied to my Keybase account. So let's say I sign this statement that I am lucb1e on Github as well as on HN as well as on Keybase. You know and can verify that I have all these identities nicely tied to my PGP key. The person who controls those identities clearly also controls the PGP key. Now comes chat. You start a chat with me, and... magic? I don't know, but there is no verification code that I can use to check that I am really talking to lucb1e on Keybase; nothing that ties it to a PGP key; nothing that ties it to the HN user. My device might be encrypting the data for an entirely different key (whose private part is known either by Keybase or some other (W)MitM ((Wo)Man in the Middle)) and there is no way to check as far as I have been able to find.
- pgeorgi 7y agoThe elephant in the room is "what to do about email", and a significant part of the issues are related to the "encrypt email" use case: part of the metadata leakage, no forward secrecy, ... The closest advice to this in the article would be "use Signal" which has various issues of its own, unrelated to crypto: it has Signal Foundation as a SPOF and its ID mechanism is outright wonky, as phone numbers are IDs that are location bound, hard to manage multiple for a person, hard to manage multiple persons per ID, hard to roll over. To me that seems to be a much bigger issue than "encrypting files for purposes that aren't {all regular purposes}".
- book-mind 7y agoIs it wrong to use openssl to encrypt files? 0. (Only once) generate key pair id_rsa.pub.pem, id_rsa.pem 1. Generate random key openssl rand -base64 32 > key.bin 2. Encrypt key openssl rsautl -encrypt -inkey id_rsa.pub.pem -pubin -in key.bin -out key.bin.enc 3. Encrypt file using key openssl enc -aes-256-cbc -salt -in SECRET_FILE -out SECRET_FILE.enc -pass file:./key.bin -- other side -- 4. Decrypt key openssl rsautl -decrypt -inkey id_rsa.pem -in key.bin.enc -out key.bin 5. Decrypt file openssl enc -d -aes-256-cbc -in SECRET_FILE.enc -out SECRET_FILE -pass file:./key.bin
- tptacek 7y agoTo start with, none of that encryption is authenticated.
- book-mind 7y agoSo if I understand you correctly (Noob here), Alice would need to sign the pair (key.enc, file.enc) to authenticate that those files originated from her. Without that, Bob could potentially receive any pair of (key,file), which would just decrypt into garbage data. BTW, variations on that sequence appear all over the internet when searching for "openssl encrypt file with public key"...
- tptacek 7y agoNo, the problem is that the AES encryption step uses bare AES-CBC. An attacker can flip bits in the ciphertext to make targeted changes to the plaintext. What you want is an authenticated encryption mode, but I don't know that the OpenSSL cli supports any of them.
- jcranmer 7y agoThis is one of the problems with cryptography: with a little knowledge, you can end up making yourself completely insecure while believing yourself to be very secure. People generally imagine that "encrypt this block of data" is a simple primitive that does everything you want it to. But naive encryption doesn't work like that. In the worst case, where you use ECB for the block cipher [1], you end up with the ECB penguin: https://blog.filippo.io/the-ecb-penguin/ https://blog.filippo.io/the-ecb-penguin/. Your secure crypto becomes a pretty trivial Caesar cipher, just on a larger alphabet. Other modes (such as the CBC mode you used) aren't so bad, but if you have some hint of the structure of the underlying data, you can start perturbing the ciphertext to manipulate the encrypted data. The modern solution to that problem is "authenticated encryption," which means that you add in an additional guarantee that the ciphertext hasn't been tampered with. Even then, there is still room for doing things incorrectly (padding is a real pain!). [1] This is so bad it shouldn't ever be an option in any tool.
- pvg 7y agoThis is great, thanks for writing it! Brings to mind the words of renowned Victorian lifehacker Jerome K. Jerome: “I can't sit still and see another man slaving and working. I want to get up and superintend, and walk round with my hands in my pockets, and tell him what to do. It is my energetic nature. I can't help it.”