Better HN
topnewbestaskshowjobs
Log inSign up

codahale

1,027 karma · joined Jun 13, 2008 (18y ago) · 143 submissions

Submissions

comment 16y ago · link · parent

It's true. That is a ridiculous policy.

They should refund him his money.

comment 16y ago · link · parent

Good god, no. Here is much better advice, in much shorter form:

If you're storing a password, use bcrypt or I'll bite your thumbs off.

If you're making sure something hasn't been modified by someone and you absolutely can't use a signed GPG message, use HMAC-SHA256 and a constant-time comparison algorithm or I'll bite your thumbs off.

All the business about hash functions is like advice on how to build your own car brakes using a backyard smelter and a sand cast. You might get something of roughly the right shape and weight but someone's going to get hurt down the road.

comment 16y ago · link · parent

From TFA: And then some fool calling himself SoSerious posted _an article_ about how much he feels DC was an idiot.

From his link: Joshua Blankenship is a designer living in Anderson, SC.

comment 16y ago · link · parent

When an "upstream" owner doesn't take patches, the usual result is that there's complete chaos and mutually incompatible forks with the same name and version information spring up.

If the upstream owner doesn't accept patches the project is hosed, regardless of how it's hosted.

The big difference with a DVCS is that those chaotic forks are public and can themselves accept patches. Developers can still pool their bug fixes, added features, etc., and perhaps the project can rise from the ashes.

If the project is hosted on a centralized VCS, all of those bug fixes and new features languish as one-off forks in private repositories. Instead of being a chaotic mess, it's moribund. You still have the same issue of having to maintain your own fork; you just don't have any help in doing so.

comment 17y ago · link · parent

I want to be excited about this, but there are big gaps in this spec.

For example, "blah"[0] should return an Object instance which represents "b". Could be a Fixnum. Could be a String. Could be a JPEG of some ASCII art representing the essence of "B." Any of those responses would be valid according to RubySpec.

What happens when you shadow a local variable with a block variable is unspecified, too. In 1.8.x, it overwrites the variable. In 1.9, it doesn't.

Even with a "RubySpec-compatible" implementation, you have no way of knowing if your application will run or not, which kind of defeats the purpose.

comment 17y ago · link · parent

Ah yes, The Financial Post. The newspaper I turn to for all of my climatological analysis. It's like International Journal of Climatology, but with better op-eds and stock listings.

comment 17y ago · link · parent

Robinson's Mars trilogy, Watts' Blindsight, Sterling's Heavy Weather and Distraction, Vinge's Rainbows End.

Off the top of my head.

98.

Thoughts on Dynamo's "flawed architecture"(dizzyd.com ↗)

24 points · by codahale · 17y ago · 1 comment

comment 17y ago · link · parent

Scala is the clear king of speed. Actors are more lightweight than threads, and a shared nothing approach means no locking, so concurrency can be maximized.

Ah, another person who's never come close to examining Scala's actor implementation. Check out scala.actors.FJTaskScheduler2. It uses threads. That's, uh, kind of the only way to get a JVM process to do things concurrently.

comment 17y ago · link · parent

So, in the 4-8 million years since H. sapiens began to diverge from what would become chimpanzees and gorillas, we gained the ability to walk and run, use tools, and use language. The females of our species stopped having estrus, the males' penises got bigger, we lost an amazing amount of hair, gained a fair bit of height, domesticated a bunch of animals and crops, and started the long process of irreversibly modifying our environment.

Despite this massive divergence from a common genetic ancestor almost 20-40 times longer ago than our species has even existed, folks still want to base what it means to be a human on what it means to be a gorilla or a chimpanzee.

To make an easier point: do you think you could be typing on a keyboard designed and manufactured by humans using a computer designed and manufactured by humans which communicates with other computers using protocols designed, implemented, agreed upon, and re-implemented by humans in order to use a service provided by a human so that humans could meet and talk about a tiny slice of the things humans meet and talk about if humans weren't embarrassingly social and cooperative?

comment 17y ago · link · parent

Yeah. "We let Twitter (via Kevin Rose) know about this before it went live but we think somebody saw the Test!" is a total numbnuts disclosure policy.

If one finds a vulnerability, follow the rfpolicy[1] or similar. Send an email to security@example.com, not Kevin Rose. (Seriously—Kevin Rose? What the hell does he have to do with Twitter's security response team?)

[1] http://www.wiretrip.net/rfp/policy.html

comment 17y ago · link · parent

Exactly.

First, check http://svn.debian.org/wsvn/ for the package you're lusting after. (In this case, pkg-ruby has the ruby1.9.1 package at 1.9.1.243-2 on trunk.)

Then, use svn-buildpackage to build yourself the damn package.

Finally, install the package, basking in the warmth of replicable, reversible package management.

comment 17y ago · link · parent

No, it will add millisecond-accuracy jitter to the timing of your algorithm. And the attacker will continue to be able to extract microsecond-accuracy data from your timing attack. You need profoundly accurate hardware and a real-time operating system. Your attacker needs… more measurements.

Caching is equally unlikely to play a role. You're probably thinking of DJB's timing attacks on AES (http://cr.yp.to/antiforgery/cachetiming-20050414.pdf), but that attack resolves around the timing of S-box lookups in which the index of the lookup is key-dependent. In the constant-time algorithm proposed by Nate Lawson and others, the only array lookup is the incremented value of a for loop (i.e., constant-time). The other operations are XOR and OR, both of which are constant-time.

Branch prediction doesn't come into play because a constant-time comparison doesn't involve conditionals until all the data has been compared.

A constant-time implementation of AES? Hard. A constant-time implementation of an array comparison? Dead simple.

Not sure why you're so resistant to the idea.

comment 17y ago · link · parent

Nope.

comment 17y ago · link · parent

Leonid Volnitsky's git-prompt is the best git-enabled Bash script I've found.

http://github.com/lvv/git-prompt/tree/master

comment 17y ago · link · parent

Perhaps it'll mean more if someone else says it:

Although nanosleep() takes a timespec struct that allows you to give an accuracy with nanosecond precision, nanosleep doesn't really give anywhere near that level of accuracy. Under Linux, the kernel only checks on timers once every "jiffie," which defaults to 1 ms under the 2.6 kernel (on older kernels it was 10 ms, and 10 ms is still a compile option in the 2.6 kernel). Once upon a time, nanosleep would busy-wait if the sleep time given was less than 2 ms, but not anymore. On the other hand, don't be too discouraged—as long as you don't need submillisecond accuracy, nanosleep() is very good…

http://www.ddj.com/linux-open-source/184402031

comment 17y ago · link · parent

You're better off just using a constant-time algorithm which uses the same number of operations for all inputs. Few systems, if any, have sub-nanosecond-resolution timers, let alone thread schedulers which have quanta of that size.

comment 17y ago · link · parent

You don't really need to. You can guarantee that the right HMAC and the wrong HMAC both take exactly the same amount of time to compare by using a constant-time algorithm like the one in the article without dealing with non-portable, unreliable timers.

(In some languages—hi Ruby!—you might not even have access to reliable millisecond-resolution timing.)

comment 17y ago · link · parent

Whoops! Correction: Yodlee does support non-US banks, including some in Canada, UK, Australia, and some Asian countries.

No idea why Mint doesn't do it. I had always assumed it was because they were share-cropping on Yodlee's architecture.

(Full disclosure: I work for Wesabe, but my snooty attitude is my own. ;)

(And yeah, ⌘⌥T is your friend when it comes to the appropriate typography.)

comment 17y ago · link · parent

Again, you should read the Crosby et al. paper (http://www.cs.rice.edu/~dwallach/pub/crosby-timing2009.pdf) and the Brumley & Boneh paper (http://crypto.stanford.edu/~dabo/papers/ssl-timing.pdf). However complicated you think the infrastructure is, you're radically underestimating the power of modern statistical analysis.

Crosby et al. conclude: We have shown that, even though the Internet induces significant timing jitter, we can reliably distinguish remote timing differences as low as 20µs. A LAN environment has lower timing jitter, allowing us to reliably distinguish remote timing differences as small as 100ns (possibly even smaller). These precise timing differences can be distinguished with only hundreds or possibly thousands of measurements.

If you'd like to bet that this sort of statistical analysis will get harder to perform over time, I'll take your wager. I'm not willing to wait until someone is publicly compromised before I fix security vulnerabilities—I do not work for an employer who's willing to tolerate a few break-ins before fixing the locks.

I'd also argue that a) a timing attack vulnerability is "weak/poor crypto," b) I don't need to write about the importance of other attack vectors (XSS, CRSF, social engineering, telepathy, bats, etc.) while writing about timing attacks, and c) if timing attacks are easy to understand and fix there would be less of them.

(Edit: fixed the B&B paper link. Derp.)

comment 17y ago · link · parent

You got it. Yodlee doesn't support non-US banks; Mint's built on top of Yodlee; ∴ Mint doesn't support non-US banks.

(Full disclosure: I work for Wesabe.)

comment 17y ago · link · parent

You may want to read this:

http://www.cs.rice.edu/~dwallach/pub/crosby-timing2009.pdf

Adding jitter will not defeat timing attacks unless the jitter is dependent on the input, like blinded RSA.

comment 17y ago · link · parent

Ah, that's a very good point. I've updated the post to return early, since figuring out the short-circuiting behavior across a handful of languages is obviously not my strong suit. Thanks for pointing that out, sophacles.

114.

A Lesson In Timing Attacks (or, Don't use MessageDigest.isEquals)(codahale.com ↗)

113 points · by codahale · 17y ago · 30 comments

comment 17y ago · link · parent

These benchmarks don't seem to take HotSpot compilation into account, which means some of those numbers are for interpreted Java bytecode and some of those numbers are for native code and you don't know which are which.

The behavior of the DBs as far as resource consumption is interesting, but the numbers are meaningless.

Further reading:

http://www.ibm.com/developerworks/java/library/j-jtp12214/

http://www.ibm.com/developerworks/java/library/j-jtp02225.ht...

comment 17y ago · link · parent

Hmm. This might be a good way to deal with entropy starvation on VM guest OSes. Kind of a niche concern, but one I happen to have.

comment 17y ago · link · parent

A serving size is 2Tbsp, which is what I put on a serving size of bread (1 slice) when I'm paying attention to how much I'm putting on. Like I said, though, I tend to slather it on (mainly because Nutella is so damn good)—so I'm really getting 1.5-2 servings of Nutella per slice.

Two slices—75kcal * 2—and a hunk of Nutella—190kcal * 3—is way the hell more calories than I should be eating as a snack (720kcal). Veeeery easy to go overboard.

comment 17y ago · link · parent

I don't think you've read the OP.

It addresses self-control: evidence exists to support the idea that human have a limited amount and range of focus of self-control, and can suffer from self-control fatigue:

http://www.stolaf.edu/people/huff/classes/GoodnEvil/Readings...

Hell, that paper was on HN not long ago.

Self-control is not a great vehicle for weight loss, as is evidenced by the recidivism rate for diets, fad or otherwise. "Use self-control" is shitty advice for weight loss. "Avoid the cue-dopamine-behavior-opioid reinforcement cycle by using cognitive psychology self-talk to associate negative emotions with salient cues, consciously pre-determining behavior for when one is presented with salient cues, and avoiding hyperpalatable foods with high levels of salt, sugar, and fat" is closer to the mark, though it's not as punchy. Also doesn't provide the same sense of moral self-satisfaction from being stronger than fat people.

I have no idea where you're coming from with the special snowflake crap. The article was not titled Exercise Won't Make You Thin (So Buy A Mu-Mu And Eat Up Fatty Because You're Never Going To Change And That's OK). In fact, the article concludes with: "In short, it's what you eat, not how hard you try to work it off, that matters more in losing weight. You should exercise to improve your health, but be warned: fiery spurts of vigorous exercise could lead to weight gain."

I fail to detect the self-esteem happy-talk fatalism to which you're reacting.

comment 17y ago · link · parent

You're ignoring the fact that the food industries in Europe and America are very different. When Italy has an Applebee's in each strip mall then Italians will be as fat as Americans. People are people; neither you nor Europeans are magical in their limited appetites. They simply haven't been conditioned from birth to overeat.

Or, alternatively, fat people are sissies. It's an, uh, interesting theory you've put forth. Best of luck in getting that paper published.

comment 17y ago · link · parent

Wheat bread's about 75 calories a slice, so 150 for just the bread. I don't know about you, but I put it on thick—maybe a serving-and-a-half per slice, which according to the Nutella website is 570 calories. So 720 total. Not 1,000, but closer to it than 239.
12345