1,326 karma · joined Jul 6, 2009 (17y ago) · 248 submissions
comment 12y ago · link · parent
This is because all the encryption features they tout depend implicitly on content (HTML and JavaScript) the server sends you every time you use the application. Because you receive this content anew on every usage, there's no way to verify what you're getting. Today it might be fine, but tomorrow it might contain a key logger or subtle cryptographic flaws.
You also can't depend on the community for help verifying this content, because it can be distributed selectively. The mass of users might get benign content while interesting targets get backdoored software.
* It might be safe to distribute something like this as an installable sandboxed web application. I'm actually not 100% certain. But the no-install-just-browse-to-this-url model is definitely insecure.
comment 12y ago · link · parent
Simply put: given the first k bits of a random stream, can you predict the k+1th bit (more than 50% of the time)?
A generator that passes this test will pass any statistical randomness test, but the converse is not necessarily true. For example Mersenne Twister is a good generator from a statistical perspective, but it's actually quite easy to recover its internal state by observing a small amount of output. (Around 20k bits, if I recall correctly.)
154.
Entropy Attacks(blog.cr.yp.to ↗)
16 points · by sdevlin · 12y ago · 1 comment
comment 12y ago · link · parent
Actually, several languages I know of have decimal types in stdlib. Two that do not are C and JavaScript.
comment 12y ago · link · parent
This isn't accurate, e.g. http://cryptome.org/2012/07/chile-comments.htm .
Bad crypto is actually much more dangerous than a single rogue dentist.
comment 12y ago · link · parent
This is not accurate. You need to know the private key for the generator, and this is not publicly known.
comment 12y ago · link · parent
The hash in question is MD2 used to reduce the 32-byte random secret to a 16-byte shared encryption key. MD2 is weak, but I'm not sure if it matters in this context. As I said above though, I'm also not sure that it doesn't matter.
comment 12y ago · link · parent
Unfortunately I can't edit anymore, so the erroneous #5 will have to stay there.
The main bad thing here is the null padding (covered in #4). This gives the attacker a lot of knowledge of the plaintext (the most significant bytes are all null), which can be used to decrypt if this format is validated on the other end. Bleichenbacher's attack only requires knowledge of one plaintext byte (the leading 02h), and we have many.
comment 12y ago · link · parent
1. There's no authentication at any point. The whole thing is trivially MITM-able.
2. The RNG is Dual_EC_DRBG, which is backdoored.
3. The RSA public key is small enough that an attacker of sufficient means could break it.
4. The RSA plaintext is unpadded. Proper padding is critical for safe RSA encryption. See e.g. Bleichenbacher '98.
5. RSA is used to encrypt semantic data. Dangerous for the same reasons as above.
6. The hash function is broken. I'm not sure if this matters too much here, but I'm also not sure that it doesn't matter.
7. The ciphertext seems to be restricted to messages of exactly 128 bits. It's not clear how or if the plaintext is padded if it's too short, and it's not clear how the protocol handles a longer message. These are noteworthy considerations.
And yet it's still (basically) safe against the kind of contest Telegram has outlined. Someone could win by factoring the RSA public key, but I'm not sure if that would be cheaper than the $200k prize. This vulnerability can also be mitigated trivially by using bigger RSA keys, making the protocol Telegram-secure.comment 12y ago · link · parent
Just so we're clear, this rules out:
* Chosen plaintext attacks
* Chosen ciphertext attacks
* Adaptive chosen ciphertext attacks
* EDIT: Also any kind of side channel
If you're keeping score at home, that's just about everything.The only thing that would fail to meet this definition of security is repeating key XOR. And RC4.
comment 13y ago · link · parent
We test software for vulnerabilities.
Sorry, that's too clinical - the reality is that we torture and flay software, twisting it to serve our nefarious ends.
If that sounds like fun, consider applying.
NO PRIOR APPSEC EXPERIENCE IS REQUIRED. Just a keen technical acumen and a thirst for blood.
Perks: crazy-smart coworkers, health benefits, free books, etc. For more information, visit http://www.matasano.com/careers/
FEED YOUR HEAD:
As a bonus, try your hand at this problem from our never-before-published set of crypto challenges: https://gist.github.com/sdevlin/52e1d8898bda7ad35567
It's not required, but writing code to solve this problem would be a good way to get our attention. For more information on the crypto challenges, visit http://www.matasano.com/articles/crypto-challenges/
comment 13y ago · link · parent
I'm fairly confident that was a joke.
comment 13y ago · link · parent
Suppose we sign https://server.com/sjcl.js. That resource is now tamper-proof in the event that server.com is compromised. But what about the rest of the application HTML/js? For example, an attacker could just say:
<script src="/sjcl.js"></script>
<script>sjcl = ...</script>
And overwrite the library on the client side.Ok, suppose the browser support for content-signing prevents this somehow. The attacker can still modify the application-level code to use the library unsafely. I'm not totally familiar with the API sjcl exposes, but consider something like the e=1 RSA bug that was found recently.
Even if sjcl's API is so great that it's impossible to misuse, an attacker could simply render application code that doesn't use it at all. Or he could just log keystrokes and phone home the pre-encryption content.
What if we sign everything, including application HTML/js? Now we have another problem. We've basically resigned ourselves to serving only static content. We can't render any user input, because this would require a new signature. Probably not a useful web app.
comment 13y ago · link · parent
The overarching problem is that you don't really get any feedback about whether what you're doing is right or wrong. For example, no cryptographer would use RSA like that, but that's not obvious just from studying the wiki article. Or from looking at the function output - it does turn ASCII into gibberish, as advertised, and that's where most developers will call it a day.
The moving parts are also treacherous. You're not just going to encrypt a string - someone is meant to decrypt it. Have you authenticated the ciphertext? Are you exposing a padding oracle? Or timing attacks? Are messages susceptible to replay? In crypto systems, these things are equivalent to locking the front door and leaving the window wide open.
In practice, most insecure crypto constructions aren't due to bugs in the implementation of RSA or AES. They're because of developers choosing inappropriate primitives, gluing them together incorrectly, or inadvertently exposing dangerous side channels.
Fortunately, there are libraries that can help. As mentioned elsewhere, NaCl/Sodium and KeyCzar provide higher-level interfaces that can abstract away many of these issues.