5 ms·
>Client-server application security: Distribute the server's public RSA key with the client code, and do not use SSL. I don't understand this part - if I'm not
by voltagex_ 13y ago
>Client-server application security: Distribute the server's public RSA key with the client code, and do not use SSL.
I don't understand this part - if I'm not using SSL, what am I doing at this point?
- mrottenkolber 13y agoSomething e.g. SSH does. A simple encrypted connection without a big certificate stack.
- tptacek 13y agoAlone among these recommendations, this one is indefensible in practice (though understandable on paper). We see people implementing "simpler" TLS alternatives somewhat routinely in our practice, and they are virtually always broken. A fear of TLS --- which is reasonable --- is an insufficient reason to expose yourself to the risks of a custom crypto protocol. You'll save yourself time and heartache if you just use SSL. Once every few years, someone will find a flaw in TLS, and once every few times that happens, that flaw will be relevant to your application. But on those rare occasions, you'll also have some of the smartest crypto implementors on the planet rushing to come up with the best fix, which is something you will never have with a custom protocol. It is worth remembering here that the overwhelming majority of TLS security issues are relevant primarily to browsers, and rely on the BEAST exploit model, where attackers have extensive and fine-grained control over what plaintexts victims generate, due to Javascript. If certificate processing code scares you --- also reasonable! --- and you're building a client/server backend system, do what enterprise software does: slurp the whole certificate into your code, fingerprint it with a hash, and verify it in a whitelist. Your TLS implementation will still verify the certificate, but you won't care; you'll rely on your whitelist for security instead.
- Retric 13y agoMy advice is IMO much simpler. Feel free to write your own crypto code that uses a SSL connection. It might not be secure on it's own, but in the small windows where SSL happens to be broken you have a little extra security and even if you just do XOR your still basically safe in the first place.
- tptacek 13y agoYou can actually end up less secure by layering additional crypto inside of SSL, particularly if (as is likely, given what most people are afraid of in SSL) your crypto involves endpoint authentication. What Colin wants to say in this document but couldn't at the time (because it didn't exist yet) and won't now (because of false modesty) is that he thinks you should use spiped instead of TLS. If he'd say that, I'd agree that was a reasonable choice.
- Retric 13y agoDo you have an example where SSL would have been secure if they had not added some other encryption scheme that broke something?
- tptacek 13y agoSure: more than one product has used SSL with SRP inside of it to replace the certificate auth, and ended up with auth bypass bugs because they didn't check parameters properly.
- Retric 13y agoreplace the certificate auth From what your saying that SSL layer was not secure on it's own. Which is a valid concern, but not what I am talking about.
- cperciva 13y agoNo, don't use spiped. As awesome as it is, spiped is symmetric -- it's designed for "I control two servers and want them to talk to each other securely", not for "I want to publish code which people can use to talk to my server". I've been considering writing aspiped though.
- pja 13y agoNaCl? http://nacl.cr.yp.to/ http://nacl.cr.yp.to/