News for hackers. Stuff that matters.
Re:Challenge HN: Break my in-browser crypto for $1000 by absherwin on Wednesday May 29, 2013 @02:14PM (#5787978)
We can argue about the merits of downloadable solutions but that isn't a flaw in this application. I'm willing to make it easy for you: You can even have the database to let you crack it without first having to break into my server.

I agree with you that there are risks to browser side crypto but how are they any different from upgrading software without reevaluating the security of each upgrade? Browser-based crypto also has benefits; most users prefer using web applications to installed all else equal because it's easier.

Re:Challenge HN: Break my in-browser crypto for $1000 by tptacek on Wednesday May 29, 2013 @02:19PM (#5788008)
Because normal users don't upgrade their applications every time they run them? I feel like people have to entertain this argument every time Javascript crypto comes up, and that it's a self-evidently silly argument. Would you feel as comfortable running SSH as a Java applet delivered from a website every time you needed it as you do running /usr/bin/ssh? Of course you would not.
Re:Challenge HN: Break my in-browser crypto for $1000 by AnIrishDuck on Wednesday May 29, 2013 @02:40PM (#5788159)
While I understand your point and agree mostly with what you're saying, it's worth noting that a functionally equivalent thing happens with /usr/bin/ssh on most linux systems.

A remote web site is consulted (usually via plain http, not even https!) and new code is downloaded. Signatures are checked locally (using gpg, which is itself bootstrapped from trusted installation media, and can be updated at any time like any other package), and then new software is installed.

The update cycle is longer, but it's still there. Under the threat model of "your source of software is compromised", no system is safe.

Re:Challenge HN: Break my in-browser crypto for $1000 by CodeMage on Wednesday May 29, 2013 @03:04PM (#5788356)
The software source for stuff like /usr/bin/ssh is a thing that has some serious infrastructure, well-established procedures and well-organized people. Right from the start the trustworthiness of that source is higher than average, arbitrary site.

I say "arbitrary", because I assume you would want to serve this JavaScript solution from your own site, the way people do with jQuery.

On the other hand, if you do decide to serve it from one central place, then you could establish similar level of trustworthiness for that source, but your solution would still be at a disadvantage. Running JavaScript is like downloading new software to your home directory on a regular basis and executing it; you don't need to compromise the software source for /usr/bin/ssh, you just need to compromise a less trustworthy bit of software and then make that bit modify the in-memory behavior of /usr/bin/ssh (because JavaScript doesn't have the kind of security the OS gives processes).

Re:Challenge HN: Break my in-browser crypto for $1000 by AnIrishDuck on Wednesday May 29, 2013 @03:14PM (#5788431)
> The software source for stuff like /usr/bin/ssh is a thing that has some serious infrastructure, well-established procedures and well-organized people. Right from the start the trustworthiness of that source is higher than average, arbitrary site.

I agree. That doesn't change my point: JavaScript or binary packages, if you're running crypto you need to be able to trust the source of your software.

> Running JavaScript is like downloading new software to your home directory on a regular basis and executing it; you don't need to compromise the software source for /usr/bin/ssh, you just need to compromise a less trustworthy bit of software and then make that bit modify the in-memory behavior of /usr/bin/ssh (because JavaScript doesn't have the kind of security the OS gives processes).

This analogy is strained. It only really applies if your site is vulnerable to XSS attacks. After that, JavaScript is generally far more restricted than your average userland code. JavaScript from one site can't modify javascript from another (well-constructed) site. Whereas you correctly point out that once you can execute arbitrary code with user level privileges, the game is usually up.

In particular, x session keylogging means you can grab a sudo password from a user once you can spy on their session, which any userland program can do. JavaScript from attack.com can't monitor keypresses on trustedbank.com unless it's explicitly included (which can happen by accident via XSS).

Look up the same origin policy to see the kind of constraints that are usually placed on JS code.

Re:Challenge HN: Break my in-browser crypto for $1000 by tptacek on Wednesday May 29, 2013 @02:41PM (#5788172)
So try to articulate why you wouldn't be comfortable just doing a "curl foo.com | bash" every time you SSH'd to a site. Obviously, very few people would be comfortable doing this.
Re:Challenge HN: Break my in-browser crypto for $1000 by AnIrishDuck on Wednesday May 29, 2013 @02:52PM (#5788257)
Because I wouldn't trust foo.com as a source of software, in your hypothetical example. If we're being hypothetical, I would have no problem running something like:

$ wget https://openssh.org/releases/openssh-blah.tar.gz ; tar -xf openssh-blah.tar.gz ; make && ./bin/ssh host

If such a thing were possible (and not hideously slow). I agree with what I believe is your thesis: good crypto is hard to do right and that you should be very careful with which sources of crypto software you trust. I just wanted to point out that trusting trust is a big problem in our industry, and isn't magically solved by using binaries on your local machine.

Re:Challenge HN: Break my in-browser crypto for $1000 by absherwin on Wednesday May 29, 2013 @02:33PM (#5788110)
How is the frequency of upgrade relevant to the security of the system? If given a new version, people tend to upgrade and I take control of your software update mechanism, how is the security risk any less? You'd presumably argue that we should have higher security standards for a software update mechanism than a web application. If that's the case, would you agree that any web application that's as secure as a software update mechanism, should be allowed to distribute JS crypto?

Edit: I have no specific problem running ssh as a Java applet if I trusted the site and connection. How do you determine when you're comfortable upgrading ssh or any other security program through your package manager?

Re:Challenge HN: Break my in-browser crypto for $1000 by tptacek on Wednesday May 29, 2013 @02:34PM (#5788117)
I gave a specific example. You fled to abstraction. I think my example is illustrative. You haven't explained why it isn't. So I'm going to decline to engage with your abstractions.
Re:Challenge HN: Break my in-browser crypto for $1000 by Dylan16807 on Wednesday May 29, 2013 @05:55PM (#5789436)
Well honestly the main reason I don't want to run the code in your literal scenario is the phrase 'java applet'. I wouldn't be very happy with a permanent one either. I think it's fair to focus on the downloading aspect, and ignore the issues of convenience/java. Then we see that people like AnIrishDuck are perfectly happy with such a scenario.
Re:Challenge HN: Break my in-browser crypto for $1000 by CodeMage on Wednesday May 29, 2013 @02:34PM (#5788115)
> most users prefer using web applications to installed all else equal because it's easier.

Except that all else is clearly not equal: your solution is insecure.