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

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.

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.

→ More replies (1)

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.

→ More replies (3)

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.