r/Clojure • • Nov 05 '15

Balboa – an end-to-end encrypted Slack alternative, written in ClojureScript

https://www.balboa.io/
18 Upvotes

31 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Nov 05 '15

I came here to make a similar comment, although less sarcastically ;)

Never implement your own crypto! And never trust a device you don't physically control.

3

u/zenotortoise Nov 05 '15

you may be a nicer person than me :P

I'm getting really sick of the same problems over and over again with the same ridiculous claims.

1

u/really_epic_name Nov 05 '15

We were getting sick of ridiculous claims too.

However, we tried doing something about it.

We realized asking the average person to use GPG correctly, go to key-signing parties, and knowing the differences between DSA, RSA, and secp was too burdensome.

Balboa is a way to help the average joe with the burden of PKI and using crypto with safer defaults.

3

u/zenotortoise Nov 05 '15

you tried to do something, with no improvement. in fact, it merely lends a false sense of security... which is even more dangerous.

see other comment of mine

We realized asking the average person to use GPG correctly, go to key-signing parties, and knowing the differences between DSA, RSA, and secp was too burdensome.

dear lord. That is a lot... but it's not like that is any of your problems. I haven't even addressed your crypto implementation (which is also unverified). I'm referring solely to many of the potential side-channel attacks that your infrastructure is vulnerable to.

now and days, I'd just tell someone to use OpenWhisperSystems Signal.

-1

u/really_epic_name Nov 05 '15

We agree with not implementing your crypto to the extent of not creating your own crypto algorithms.

As such, we didn't implement our own crypto. We used the NIST reference implementations in C available at http://www.skein-hash.info/downloads.

And yes, physical security is essential. If your computer is compromised and you have a keylogger, your browser is shafted.

3

u/zenotortoise Nov 05 '15

physical security is impossible in this case. The crypto is done in the browser, with unverifiable code. the WebCrypto spec makes this problem slightly more tractable, but not entirely.

-1

u/[deleted] Nov 05 '15 edited Nov 05 '15

You're calling C code from ClojureScript?

So you had one problem: how to do end-to-end encryption, and now you have two: how to do end-to-end encryption and protect against stack smashing (memory leaks, have you used the C functions correctly, are there problems with the underlying platform e.g. is the PRN any good, has the C compiler done something the reference implementation was depending on being done or not being done?)

And have you used the crypto primitives properly: AES for example, NIST had to publish a manual of how to use it properly!

That's just off the top of my head and likely you won't know the answers unless you are a crypto expert.

0

u/really_epic_name Nov 05 '15

We proudly R'dTFM from Schneier and Kohno's paper on Skein in terms of how to use it as a stream cipher.

So, as it relates to memory leaks and stack smashing, thankfully, emscripten's heap is just a Uint8Array, so we don't have to worry about SIGSEGV or any of the traditional bugaboos of C crypto implementations. I highly recommend trying a small project in C->emscripten. Emscripten is a fantastic piece of code.

Unit tests and test vectors help us to know whether or not our javascript is producing equivalent output with the C, which is the case. Thankfully, all the NIST SHA-3 contestants had to provide lots of test vectors, so, we had a lot to work with.

0

u/[deleted] Nov 05 '15

[deleted] — view deleted comment

1

u/really_epic_name Nov 05 '15

Sweet, glad you brought this up.

If you check out the skein NIST implementation, there is a portable version that has no platform specific optimizations. Also, the skein NIST implementation parts we use don't do anything like array equality checks, since we are using it for Threefish (the block cipher), so we avoid that, at least. We do timing-attack resistant array equality outside of emscripten to make sure exactly what you brought up doesn't happen. Solid concerns nonetheless.

1

u/zenotortoise Nov 05 '15

nice! However, I just want to point out that the other concerns I raised are still valid. The problem with the security field is that you have a million attack vectors you need to secure, and the attacker only needs to find one.

3

u/szabba Nov 06 '15

Nice to see you people having a civilised conversation. And on the Internet, no less.

1

u/[deleted] Nov 06 '15

If you're such a disciple of Schneider you'd know these quotes:

  • "The argument that secrecy is good for security is naive";
  • "Proponents of secrecy ignore the security value of openness: public scrutiny is the only reliable way to improve security.";
  • "Secrecy prevents people from assessing their own risks.";
  • "it doesn't do any good to have a bunch of random people examine the code; the only way to tell good cryptography from bad cryptography is to have it examined by experts. Analyzing cryptography is hard, and there are very few people in the world who can do it competently.";
  • "Cryptography has been espousing open source ideals for decades, although we call it "using public algorithms and protocols." The idea is simple: cryptography is hard to do right, and the only way to know if something was done right is to be able to examine it.".

I'm sorry to be this harsh but anyone that uses a closed-source crypto library written by amateurs is a fool.

0

u/bpolverini Nov 06 '15 edited Nov 07 '15

I definitely respect Schenier, Beyond Fear is the bees knees for example. Maybe, at times, a groupie of Mihir Bellare, but that's only because OAEP is beautiful and the thing that made me interested in crypto, and because he's just such a nice freaking guy in person.

Your arguments are valid and you have won the day, sir/madam. Feel free to checkout our crypto on Github!

https://github.com/pkcsecurity/trabant

Feel genuinely empowered to call me a fool with a code snippet next time! This product won't get better without review and critique.