News for hackers. Stuff that matters.
Re:RSA is a fragile cryptosystem by lvh on Monday July 08, 2019 @09:06AM (#20382356)
We wrote a blog post for that: https://latacora.micro.blog/2018/04/03/cryptographic-right-a...

To answer your specific comments: firstly, you don't need public key crypto. If both you and your sender can agree on a secret key, you can use secret key crypto just fine. For that, use libsodium's secretbox.

If you really need public key crypto for some reason, libsodium's box is what you want.

What's the "untrusted channel" here? Is this really about encryption in transit, or encryption at rest?

Re:RSA is a fragile cryptosystem by IggleSniggle on Monday July 08, 2019 @09:34AM (#20382549)
Suddenly I’m more confused. How can you agree on a secret key, remotely, without some foundational source of trust? I don’t trust the default CA packages anymore, given the prevalence of untrustworthy vendors like Comodo.
Re:RSA is a fragile cryptosystem by lvh on Monday July 08, 2019 @09:41AM (#20382600)
Yes, you need some foundational source of trust, but you were going to communicate that public key one way or another. If you don't trust that medium (let's say it's WebPKI TLS and an adversary gets a bad cert from Comodo somehow), the adversary could just lie about the public key too. A MITM adversary that's in a position to unseal and reseal libsodium secretbox messages can also do that with libsodium box.

(For everyone else: just because I'm playing along with this misissuance scenario doesn't mean I don't think ~everyone should trust WebPKI.)

Re:RSA is a fragile cryptosystem by tptacek on Monday July 08, 2019 @09:36AM (#20382563)
He’s saying that if you can get away with generating something like a random API key and just having the client save that, that’s much safer than using public key cryptography.
Re:RSA is a fragile cryptosystem by fireflash38 on Tuesday July 09, 2019 @07:45AM (#20390820)
Minor clarification:

> that’s much safer than using public key cryptography.

It's much harder to screw up than using PKC (thereby making it safer). It's something that is really important for UX - you want to make the easiest path the safest path.

Re:RSA is a fragile cryptosystem by tptacek on Tuesday July 09, 2019 @11:56AM (#20393081)
No. Don't go looking for reasons to use public key where the underlying design doesn't necessitate it.
Re:RSA is a fragile cryptosystem by curryst on Monday July 08, 2019 @10:50AM (#20383197)
In a private scenario (i.e. most B2B usage), you can communicate the key through a different channel. One option would be to write it down on a piece of paper, and fly someone to the other business to deliver it. Now both sides have a copy of the key, and transmission is guarded by your trust in your employee to not skim the key.

Mail is another option, depending on how secure you think that is.

Re:RSA is a fragile cryptosystem by tabletopneedle on Monday July 08, 2019 @12:57PM (#20384372)
It's much safer to just send the public key over whatever medium and then use an authenticated channel to verify the authenticity of said public key.
Re:RSA is a fragile cryptosystem by Natanael_L on Monday July 08, 2019 @03:14PM (#20385797)
How often do you have a reliable tamper resistant authenticated channel that isn't also secret?
Re:RSA is a fragile cryptosystem by tialaramex on Monday July 08, 2019 @04:23PM (#20386406)
I might be confident that bad guys won't realise what's going on and somehow break into my email system replacing your public key with their own in, say, six hours it takes to receive and act on the message; whereas I can't be reasonably confident that all my mail systems and all backups of mail systems will remain unbreakable for the foreseeable future or until I've deleted all trace of the symmetric key.

Cryptography is often not about "uncrackable" but about confidence in security over a foreseen interval.

On the 4th of June 1943 the details of Operation Neptune ("D-Day") were a priceless secret of the Allied Command, a break that allowed Berlin to know the plan could have resulted in the invasion force being expected by a heavily prepared and well-reinforced German defence. Those who made it back to England alive would have no reward for their efforts.

By the 7th of June 1943 plans for Neptune were a historical curiosity of little military value.

Re:RSA is a fragile cryptosystem by anonymousisme on Monday July 08, 2019 @06:33PM (#20387378)
Good comment, but I couldn't help notice that you got the date (6/6/1944 != 6/4/1943) wrong for Operation Neptune/Overlord: https://en.wikipedia.org/wiki/Operation_Overlord
Re:RSA is a fragile cryptosystem by tialaramex on Tuesday July 09, 2019 @04:11AM (#20389826)
D'oh. I swear I had the year correct (it's supposed to be a few days before the invasion because the Germans wouldn't be able to respond instantly) in an earlier draft. Thanks for the correction.

And I did mean Neptune, the Overlord plans would have remained valuable for several weeks as they included details of the immediate objectives in Normandy and how resupply would be done, Neptune was just the invasion and related actions.

Re:RSA is a fragile cryptosystem by munchbunny on Monday July 08, 2019 @01:54PM (#20385052)
Establishing a secret key and a secure channel does not require trust. It just requires a pair of keys so that you can be sure that the message gets to the other party unintercepted and unmodified.

However, just because you have a channel that can't be MitM-ed doesn't mean you can actually trust whoever is on the other end. The problem of "how do you know you trust the other end" requires some foundational source of trust, whether that's trusting the transportation medium (that the person you handed the USB key to is actually who he/she claims to be), the issuer (could be yourself), and so on.

Re:RSA is a fragile cryptosystem by raverbashing on Monday July 08, 2019 @09:53AM (#20382702)
Would Diffie-Hellman (still) be a good way of exchanging secrets? ECDH?
Re:RSA is a fragile cryptosystem by tptacek on Monday July 08, 2019 @10:57AM (#20383264)
Don't freelance your own kex protocol. Don't use multiplicative group DH. Don't use the NIST p-curves to implement ECDH, which will require you also to implement point validation to avoid invalid curve attacks. You want something like Curve25519 DH, but depending on your application, you probably also want an authenticated key exchange, which a naive Curve25519 protocol isn't going to give you.
Re:RSA is a fragile cryptosystem by loup-vaillant on Monday July 08, 2019 @06:38PM (#20387413)
> Don't freelance your own kex protocol.

Considering it took me 8 months to not even finish my own, making several serious mistakes in the process, even though I wrote my own goddamn crypto library and am standing on Noise's shoulders…

I tend to agree.

That said, we still have a problem: `crypto_box()` is nice, but it doesn't have any kind of forward secrecy, identity hiding, or key compromise impersonation resistance. Sure, offline protocols can't really have that (the best you can do is use signatures to avoid the key compromise impersonation issue, but then you loose some deniability). Online protocols however, can.

But then what do we do? We could use Noise, (the Noise explorer now generates code in several languages), but you at least have to chose a pattern. Which one? How can you even notice that XK1 maximises client anonymity, and IX (properly used) maximises server security? Even if you know that, which are you going to use?

And I'm not even talking about implementing your Noise pattern, should existing implementations not suffice (maybe you want to leverage a custom crypto library optimised for some embedded processor). Noise isn't simple. A serious drawback in my opinion.

This, if I guess correctly, is what led you to recommend that horror that is TLS for client/server security. Because the burden of choosing a reasonable TLS library, of properly configuring that TLS library to only use TLS 1.3 with a limited set of ciphers (possibly just Curve25519 and ChaPoly)… still remains less error prone than picking up a Noise protocol. <PKI matters conveniently left out>

That situation is deeply unsatisfactory. It's all well and good to tell people "don't make your own kex", but if you don't at the same time point them to an existing kex, they will be less likely to follow your advice. I mean, I didn't.

Re:RSA is a fragile cryptosystem by lvh on Monday July 08, 2019 @09:55AM (#20382718)
Depending on context the answer is "absolutely" or "absolutely not", so that's hard to answer. I definitely wouldn't tell you to use finite-field Diffie-Hellman in any context, or any derived cryptosystems (ElGamal or IES), no.
Re:RSA is a fragile cryptosystem by rocqua on Monday July 08, 2019 @10:21AM (#20382928)
I might be misreading, but it seems like you advise against IES. If so, does that extend to ECIES? I ask because the actual article actually suggests ECIES.
Re:RSA is a fragile cryptosystem by lvh on Monday July 08, 2019 @11:34AM (#20383608)
"Finite-field" is the operative phrase in that sentence. I wouldn't tell you to use IES, as in the thing where you do g^xy mod p. I would tell you to use libsodium's box, which is a specific implementation of something sorta like ECIES, though.

The confusion is that IES/ElGamal sometimes means a family of systems and sometimes someone literally means FFDH + AESCTR or something. The abstract concept is fine, but you should use a hardened implementation.

Re:RSA is a fragile cryptosystem by ralusek on Monday July 08, 2019 @12:38PM (#20384173)
Diffie-Hellman is what you use if you trust that the public key belongs to who you think it does. In many cases, that's totally fine. It'll either be hosted on their server, or even hard coded into the client application you're communicating from. RSA + DH is the attempt to deal with an untrusted public key.
Re:RSA is a fragile cryptosystem by linsomniac on Monday July 08, 2019 @10:06AM (#20382788)
^^^ I know this chap, he knows what he's talking about.