3 ms·
Rolling your own crypto is incredibly perilous. Now, the Cryptocat team could discard their own code, compile GnuPG with emscripten [1] and adopt the existing U
by networked 13y ago
Rolling your own crypto is incredibly perilous. Now, the Cryptocat team could discard their own code, compile GnuPG with emscripten [1] and adopt the existing UI/UX to using that but who's to say GnuPG is still going to work correctly on that new platform?
The only "easy" (if insane) solution I can think of for building GPG on a known platform and still having it run in the browser is to use something like JSLinux [2] and run GnuPG inside a hidden VM communicating with it over an emulated serial interface. Then again, I'm sure that could introduce all sorts of interesting issues related to timing and randomness.
Cryptography is damn hard.
Edit: I'm aware that they've used CryptoJS but, much like calling OpenSSL directly, I would still count that as "rolling your own".
[1] See, e.g., http://manuels.github.io/unix-toolbox.js-gnupg/ http://manuels.github.io/unix-toolbox.js-gnupg/.
[2] http://bellard.org/jslinux/ http://bellard.org/jslinux/
- amouat 13y agoBut they didn't roll their own crypto as far as I can tell. They used CryptoJS [1]. They just failed to use it correctly. EDIT: Here's the code https://github.com/cryptocat/cryptocat/blob/master/src/core/js/lib/multiParty.js#L37 https://github.com/cryptocat/cryptocat/blob/master/src/core/... [1] https://code.google.com/p/crypto-js/ https://code.google.com/p/crypto-js/
- amouat 13y agoWhilst there may still be plenty of scope for error, I think there is a large difference between using CryptoJS and "rolling your own". I wonder how "correct" CryptoJS itself is though.
- networked 13y ago> Whilst there may still be plenty of scope for error, I think there is a large difference between using CryptoJS and "rolling your own". I agree to some extent but as the article we're commenting on proves, the scope for error is enough for you to render your encryption useless against an attacker armed with just a modern desktop PC.