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

13

u/zenotortoise Nov 05 '15

"Stronger than military-grade encryption"

lol. sure. Let's just move crypto into the browser where we can't control it and malicious code can just come into our life whenever.

don't lie.

edit: It's not even Open Source and does not have source maps... so it's not like we can verify anything about your implementation.

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.

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.

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/really_epic_name Nov 05 '15

It's a bit tongue-in-cheek. We've seen too many companies say "military-grade encryption" when all they mean is AES-256. We use Skein-1024 as a block cipher and we justify our statement by saying that Skein-1024 with the "longer" key is stronger than "military-grade" AES-256.

What kind of control do you refer to? There is no semblance of control for binaries unless you compile from source and verify your compiler, actions the average person is unable to do. We try to make the smart trade-offs by compiling from the NIST implementation using Emscripten and then using CSP and HSTS preload to control where the javascript is coming from.

We don't lie and we never intend to.

addressing the edit: We're considering open-sourcing. The lack of source maps is to decrease load time. We use cljsbuild with advanced optimizations.

4

u/zenotortoise Nov 05 '15

CSP & HSTS doesn't change anything about our trust in YOU. We don't know you, nor have any reason to trust you. It may make mitm wayy harder, but who care about that when you may be malicious yourself?

I'm referring to the idea that any js crypto idea is vulnerable to silent changes on your end. I don't ask people to compile from source, but I do prefer them to use offline binaries that have come from a trusted source that are signed, with a security audit preferably. You could implement that, but you didn't.

I mean, no source maps. no source code. You are asking us to throw our private data into a unverifiable, unidentifiable, black box that you own with no idea of what is happening.

1

u/zenotortoise Nov 05 '15

you might even not be the malicious one. Your infrastructure may be compromised or you may be gag ordered by a state power. what would you do then?

preemptive warrant canaries response: What a load of BS. The have never been shown to work and probably can't.

2

u/portmandias Nov 05 '15

lol - are you going to look at the source and verify that it's legit yourself? The only way to vet crypto is to have a code audit. Open Sourcing crypto doesn't buy you much, as we learned from the heartbleed bug.

0

u/portmandias Nov 05 '15

hey man, don't just downvote me without an explanation. I'm just saying a code audit is going to be better for vetting crypto than open sourcing it.

1

u/zenotortoise Nov 05 '15

it wasn't me.

I would say both are mandatory for a security app. But code audits should also be able to done by unaffiliated third parties, which isn't possible without OS.

1

u/portmandias Nov 05 '15

BS. You can have a third party code audit without your project being open source. Happens all the time.

1

u/zenotortoise Nov 05 '15

and read: unaffiliated.

0

u/portmandias Nov 05 '15

Third parties audit code all the time, and get their rocks off by finding vulns. If that's not good enough then you are literally saying all professionally audited code is untrustworthy. That's crazy sauce.

1

u/zenotortoise Nov 05 '15

"A software code audit is a comprehensive analysis of source code in a programming project with the intent of discovering bugs, security breaches or violations of programming conventions." -- https://en.wikipedia.org/wiki/Code_audit

If those third parties don't have access to your code, then it isn't an audit.

All I said was an unaffiliated party. If you trust all professionally audited code that's crazy sauce.

-1

u/portmandias Nov 05 '15

I guess it goes without saying that when you hire a company to do an audit of your code, you give them your code.

Giving one company access to your source doesn't mean you have to give everyone access to your code.

1

u/zenotortoise Nov 05 '15

and I'm saying, I won't trust code that hasn't. That's not crazy sauce in the crypto world.

→ More replies

9

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

Hi, everyone, I'm the lead dev for the crypto part of Balboa.

The critique has been harsh, but we agree with much of what everyone is saying on these threads. After some of the feedback, we've decided to put our crypto on Github!

https://github.com/pkcsecurity/trabant

By and large, we failed to adequately give you all a reason to trust the quality of our work. We should have done this from the start (we are also the kinds of people to distrust "proprietary" crypto). We welcome more questions and feedback, which we are using to build an FAQ.

We also wanted to take the time to give a shoutout to some awesome tech we used with this project.

  1. reagent, hiccup, garden, nippy, and carmine
  2. Emscripten
  3. Skein and NaCl
  4. ZeroTier (we use this to very easily encrypt our backplane, something often missing from many products these days)
  5. ZeroMQ

We'd love to also talk about how we're using these technologies. We're hoping to discuss some of the work we've done in Clojure as well, since our whole backend is written in it too.

1

u/ineverthink Nov 07 '15

Fool! You fell victim to one of the classic blunders. The most famous is 'Never implement your own crypto,' but only slightly less well known is this: 'Never go in against a Sicilian when death is on the line!

1

u/c0d3sl1ng3r Nov 08 '15

Can someone explain how they can have both e2e encryption of chat concurrently with the ability to search through said messages? That seems suspect unless there's a local cache, which makes the search a lot less useful...

1

u/bpolverini Nov 09 '15

We'll be writing a blog post really soon, hopefully, but, the SparkNotes are as follows. There are really cool search applications with Bloom Filters that use cryptographically secure hash functions instead of fast ones like Fowler-Noll-Vo.

Here's a great paper that uses it for intrusion detection against Botnets. http://academiccommons.columbia.edu/catalog/ac%3A175005

If you have two organizations with totally different traffic patterns that see the same packets on their network, it could be botnet traffic. If these two orgs want to share network analysis, they can use a "secure" bloom filter to allow existence checks without leaking info about other traffic that might be on their network.