HNHacker News
TopNewBestAskShowJobs

sdevlin

1,326 karma · joined July 6, 2009

submissionscomments
sdevlin··on Ask HN: Should an RSA public exponent be prime?
I think e needs to be coprime with phi(N) rather than N itself. This is so you can find d = e^-1 mod phi(N), which would otherwise not exist.

Of course, if e shares a factor with N, you have bigger problems.

sdevlin··on Show HN: What parts of your code are not original
Why did you need to write an implementation of Mersenne Twister?
sdevlin··on Socat: “the hard coded 1024 bit DH p parameter was not prime”
Some of these issues are orthogonal.

You're correct that the ring of integers mod n with n composite will have small multiplicative subgroups. But so will the integers mod p with p prime. At the very least, 1 and p-1 will always have orders 1 and 2, respectively. I could be wrong, but I don't think the primality or compositeness of the modulus alone tells you much about the smoothness of the group order.

Small subgroups may not always lead to key recovery, but they can lead to key dictation in certain protocols. So subgroup-confinement attacks are always a consideration in this setting.

If you want to learn more about subgroup-confinement attacks on DH and ECDH, check out set 8 of cryptopals. Mail set8.cryptopals@gmail.com with subject "Crazy Flamboyant for the Rap Enjoyment".

sdevlin··on MEGAChat now includes end-to-end encryption
Cure53's report details a complete bypass of WebSign as implemented, as well as stern warnings against relying on a non-security feature for security.
sdevlin··on John Romero has released his first Doom level in over two decades
Double Fine's Devs Play series might be interesting to you. The first season includes a bunch of videos featuring John Romero talking about Doom. Here's a playlist: https://www.youtube.com/playlist?list=PLIhLvue17Sd6u2akeZZdY....

There are also a few videos where a guy does some live ROM-hacking on the original Zelda.

sdevlin··on Juniper: Recording Some Twitter Conversations
It depends on how P and Q are generated.

The NIST document specifying Dual EC offers default values for each curve. P is the usual base point for the curve; an arbitrary point Q is provided without justification or details of its generation.

Because the NIST curves have cofactor 1, all points other than the identity generate the same subgroup. This means any two points P and Q are related by some scalar d such that d * P = Q. Knowledge of d is the back door in the generator.

This also implies a simple means for choosing Q given P: pick a random integer d and calculate Q = d * P. Publish P and Q and then write down d someplace safe. This is exactly how NSA is speculated to have chosen the Dual EC parameters.

However, the NIST document also specifies a method for generating alternative points. It boils down to hashing a random seed and mapping the result to a curve point. If you generate the base points P and Q like this, the relationship between them is unknown. The scalar d still exists, but now no one knows what it is. Without that knowledge, there is no back door.

It's not clear from that page how Juniper chose the parameters. Maybe they did choose a random scalar and multiply P, or maybe they followed the standard. The information on that page isn't enough to say one way or the other.

EDIT: Just to be clear, I'm not saying this isn't something to worry about. You should distrust and avoid anything that relies on Dual EC. I'm only saying there is not enough information to say definitively that Juniper put a back door in their own product, intentionally or otherwise.

sdevlin··on A Guide to Fully Homomorphic Encryption
AES (and other symmetric ciphers) are vulnerable to Grover's algorithm (https://en.wikipedia.org/wiki/Grover%27s_algorithm), which effectively cuts key sizes in half. AES-128 would be reduced to 64-bit security. This isn't a big problem in practice, since we can just switch to 256-bit ciphers like AES-256 and ChaCha20.

Public-key schemes based on factoring and discrete logarithms are undone by Shor's algorithm (https://en.wikipedia.org/wiki/Shor%27s_algorithm), but there are asymmetric systems not known to be vulnerable to quantum algorithms. They are less mature, but researchers are working it.

There's some good high-level information at http://pqcrypto.org/ and in this paper: http://pqcrypto.eu/docs/initial-recommendations.pdf.

sdevlin··on CommonCrypto in Swift
If you're looking for more crypto challenges, we've just released set 8 of Cryptopals. It's kind of a "soft" release; it's not on the site yet. Mail set8.cryptopals@gmail.com with subject "Crazy Flamboyant for the Rap Enjoyment".

This set provides an introduction to practical attacks on elliptic curves as well as some neat key-recovery attacks on GCM.

sdevlin··on MTProto, the symmetric encryption scheme used in Telegram, is not IND-CCA secure
It happens. :)

I agree, POODLE is a close analog.

sdevlin··on MTProto, the symmetric encryption scheme used in Telegram, is not IND-CCA secure
BEAST and CRIME are both chosen-plaintext attacks. They don't rely on the improper MAC composition in TLS CBC.

Lucky13 and POODLE are the chosen-ciphertext attacks.

EDIT: Some more details:

BEAST takes advantage of predictable IVs in SSLv3 and TLS 1.0. In these protocols, the IV for each new record is simply the last block of the previous record. An attacker monitoring traffic on the wire can use this predictability to build an encryption oracle and guess-and-check the contents of ciphertext blocks.

CRIME uses plaintext compression to its advantage. A message with longer common substrings will compress slightly better than one without, and this is reflected in the ciphertext length. An attacker can make adaptively chosen guesses at substrings included in the message to recover, e.g., session cookies.

sdevlin··on MTProto, the symmetric encryption scheme used in Telegram, is not IND-CCA secure
Theoretical attacks have a way of turning into weaponized exploits.

For example, check out https://www.openssl.org/~bodo/tls-cbc.txt. This is a document published by Bodo Moeller in the early 2000s that details multiple theoretical weaknesses in the CBC mode used in TLS. Read it top to bottom and see how many practical attacks on TLS you can count.

sdevlin··on Announcing .NET Core and ASP.NET 5 RC
Thanks!
sdevlin··on Announcing .NET Core and ASP.NET 5 RC
Is MVC the default ASP.NET workflow now? Is it the only workflow? Are Web Forms still supported?
sdevlin··on Teensy weensy crypto
If that is true, the author should avoid words like "secure" and "unbreakable".
sdevlin··on Teensy weensy crypto
> With this (and your computer) you can secure a message with a password in a way that's unbreakable. I can't break it, your government can't break it, other people's governments can't break it. Secure.

Argh. No.

> Should you use it? No. There's many important missing features that are present in proper symmetric encryption tools, such as proper key derivation, protection against modification, IVs, and fewer bugs.

This (buried) warning makes these things sound like bells and whistles. The truth is they're essential to security.

Here are some good reasons not to use this for anything:

1. It conflates passwords with keys. Users will not choose high-entropy passwords when left to their own devices.

2. It doesn't take an IV. This means a given password will always generate the same key stream, which means password reuse will lead to plaintext recovery by simple statistical methods. There are no warnings about this.

3. It's not authenticated. An attacker can modify messages in flight with unexpected consequences that very often include plaintext recovery.

4. RC4 is irreparably broken. Dropping 1024 bytes from the key stream might help in the author's intended use-case (assuming users adhere to it), but this is not an effective mitigation in general. The best attacks on RC4 rely on periodic biases that persist over the entire key stream.

sdevlin··on Introducing 1Password for Teams
TweetNaCl is a C library.
sdevlin··on A riddle wrapped in a curve
Dual EC specifies two standard curve points. The "kleptographic" back door is the relationship between them, i.e. the knowledge of d in the equation P = dQ. This hidden relationship was apparent to cryptographers pretty quickly, see http://rump2007.cr.yp.to/15-shumow.pdf.

What would it mean for a curve to have a "kleptographic" back door? Only one base point P is defined in the curve parameters, so there is no hidden relationship to take advantage of. It is possible there are weaknesses in the NIST curves, but if so:

1. They must lie in the curve parameters themselves, i.e. something anyone could conceivably discover.

2. They must rely on a significant advance in ECDLP, e.g. a new class of weak curve.

sdevlin··on A riddle wrapped in a curve
The paper or the post?

I think the paper is maybe slightly dismissive, closer to neutral: "it is conceivable the NSA has found ...".

The post seems more enthusiastic:

"the most intriguing hypotheses in the paper"

"Beginning with the smallest of the standard curves, P-256, which would now provide less than the required 128-bit security.

Did I mention that as part of the recent announcement, NSA also deprecated P-256?"

He backtracks a little in the following paragraph ("Of course, there’s no reason to believe ..."), but I think the conspiratorial tone is pretty well established by then.

It's also just the fact that he spends about a third of the post talking about this explanation without really covering any of the others. If I hadn't read the paper, I'd come away with the impression that this is the main theory they put forth.

sdevlin··on A riddle wrapped in a curve
The paper discusses the quantum case:

> However, it will require major advances in physics and engineering before quantum computing can scale significantly. When that happens, of course P-256 and P-384 will fall first. But, as the head of cybersecurity research at a major corporation put it, “after that it’s just a matter of money” before RSA-3072 is broken. At the point when P-384 is broken it would be unwise to use either ECC or RSA. It is not likely that the gap between quantum cryptanalysis of a 384-bit key and a 3072-bit key will be great enough to serve as a basis for a cryptographic strategy.

sdevlin··on A riddle wrapped in a curve
The post talks about hypothetical improvements in non-QC approaches to the ECDLP.
sdevlin··on Freestart collisions for SHA-1
Yes. It's usually not even accessible through the hash function's exposed interface.
sdevlin··on Julia's Arraypocalypse Release
The post you're responding to says explicitly in the first sentence that these are breaking changes.
sdevlin··on Enough with the Salts: Updates on Secure Password Schemes
Isn't PBKDF2 in the stdlib as hashlib.pbkdf2_hmac?
sdevlin··on Show HN: Encrypted Communication via GitHub Using Node.js and SSH Keys
I don't know if I would characterize NaCl as "enormous". TweetNaCl is literally two files. Libsodium has a bigger footprint, but it also seems to have bindings for pretty much every language. I would think it's pretty easy to integrate.

I definitely do not think the proliferation of unvetted, anonymous crypto libraries is a good thing. How many people have the expertise to write this kind of thing? How many have the expertise to evaluate its quality?

For example, the documentation for the linked library says: "we've also added integrity checking in the form of a SHA 256 hash." This is a huge red flag: hashes provide integrity, but not authenticity, which is really what you want here. But then you go and look at the source code and find that they are actually using HMAC-SHA256, which does provide authenticity. So the documentation is not an accurate description of what's going on, and you need to go and look at the source to find out that it really is okay (in this particular aspect, though it doesn't inspire confidence for the future).

My point is not to say that this particular library is terrible or anything. Just that we have limited resources, and we're better off consolidating to a very small number of solutions designed, written, and validated by experts.

sdevlin··on Show HN: Encrypted Communication via GitHub Using Node.js and SSH Keys
This is unfortunately sort of common. Java's crypto package exposes a similar interface.
sdevlin··on Snake Oil Crypto Competition
The major complaint against AES is that it is very difficult to implement in a data-independent way without hardware support. Bernstein has done some research on this (http://cr.yp.to/antiforgery/cachetiming-20050414.pdf), and a major theme of his research has been designing systems that are friendly to implementers.

I have no idea if that is what this specific dig ("they already master the art of snake oil") pertains to.

sdevlin··on Web's random numbers are too weak, researchers warn
The authentication mode for GCM is sort of fragile. While nonce reuse is always bad, it's particularly disastrous in GCM in that it immediately leaks the authentication key. Similarly, using GCM with a truncated authentication tag makes forgery easier than you'd expect and again leaks the authentication key in the process.

GCM is also difficult to implement in software for the same reasons AES is: the high-performance implementation strategies tend to rely on precomputed tables. This puts memory pressure on servers that handle a large number of keys concurrently. Table-based implementations also tend to expose cache-timing side channels. Fortunately, modern Intel machines have instructions (e.g. PCLMULQDQ) that aid implementations, though I'm not sure how widespread their use is in practice.

To be very clear, GCM is still a fine choice, and much safer than composing authentication and encryption yourself.

If you have access to it, NaCl's Secret Box is a good choice that avoids these problems. Libsodium implements NaCl and is pretty widely available, I think. OCB is also a good choice, though I haven't seen many implementations of this.

EDIT: For those interested, Niels Ferguson's criticism of GCM (http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/comment...) is a great read. Lots of minor practical issues (e.g. specifying bit strings rather than byte strings, performance measurement across platforms, etc.) along with the aforementioned attack on short authentication tags.

sdevlin··on Go 1.5 Beta
> Also in the crypto/cipher package, there is now support for nonce lengths other than 96 bytes in AES's Galois/Counter mode (GCM), which some protocols require.

This should be "96 bits".

sdevlin··on A New Encryption Standard of Ukraine: The Kalyna Block Cipher
Interesting notes, I didn't realize the competition was so old. Thanks!
sdevlin··on A New Encryption Standard of Ukraine: The Kalyna Block Cipher
Building around S-box lookups also seems like a weird choice in 2015. I looked and couldn't find any considerations for cache-timing side channels. There really wasn't much advice for implementers at all.

I'm not sure this is a major vulnerability in practice, but it is strange not even to mention 10+ years of cache-timing attacks against AES.

← PreviousPage 2 of 8Next →