News for hackers. Stuff that matters.
Re:Those 500K Bitcoins that caused the flash crash weren't real by rlpb on Thursday June 30, 2011 @07:33PM (#2716195)
"The new Mt. Gox site features SHA-512 multi-iteration, triple salted hashing"

Why not use a standard key derivation function such as PBKDF2 or bcrypt to provide some confidence in the system rather than inventing their own?

AFAIK bcrypt is strong because of Blowfish's expensive key setup. How does this compare to SHA-512?

Re:Those 500K Bitcoins that caused the flash crash weren't real by daeken on Thursday June 30, 2011 @07:36PM (#2716203)
The part that bothers me about that is "triple salted hashing". This could mean any number of things, all of which point to a misunderstanding of what a salt is for.
Re:Those 500K Bitcoins that caused the flash crash weren't real by Joakal on Thursday June 30, 2011 @07:41PM (#2716222)
Triple salted hashing sounds like either there's three salts in a hash or it's hashed with a salt three times.
Re:Those 500K Bitcoins that caused the flash crash weren't real by Xk on Thursday June 30, 2011 @08:09PM (#2716303)
That is indeed what it sounds like, but what's really worrisome about that is that anyone who thinks the solution to keeping passwords is to triple-salt them really needs to learn some things about keeping passwords safe.

I could quintuple-salt my passwords with 4096 byte salts chosen purely randomly and there would be no perceivable advantage over a single 512 bit salt.

Re:Those 500K Bitcoins that caused the flash crash weren't real by seanalltogether on Thursday June 30, 2011 @08:07PM (#2716293)
Perhaps they mean it's salted by 3 different environments, so an attacker would need to crack the db server and 3 other servers just to get a chance to start cracking the passwords.
Re:Those 500K Bitcoins that caused the flash crash weren't real by daeken on Thursday June 30, 2011 @08:08PM (#2716297)
That would mean that logins would have to go through 3 different servers. If anything, I would be more worried about security in that case.
Re:Those 500K Bitcoins that caused the flash crash weren't real by gojomo on Thursday June 30, 2011 @09:02PM (#2716497)
Not necessarily. Let's say the salt is a combination of a per-user salt in the database, a per-user salt from a file on disk, and a per-system salt that's entered at the console at startup and held in memory.

A DB compromise doesn't reveal the other 2 salts. A full filesystem image doesn't reveal the third salt. Even an interactive root compromise would need to know to take an image of the running system's memory to get the third salt.

Re:Those 500K Bitcoins that caused the flash crash weren't real by uxp on Thursday June 30, 2011 @09:40PM (#2716619)
Why reinvent the wheel using engineering techniques you only have cursory knowledge of from reading an encyclopedia?

There is a standard method of securing online accounts, using known methods that are currently known to be perfectly safe in every application from financial institutions to the latest social networking site. Triple-salting passwords is not that method.

http://codahale.com/how-to-safely-store-a-password/

http://chargen.matasano.com/chargen/2007/9/7/enough-with-the...

Re:Those 500K Bitcoins that caused the flash crash weren't real by gojomo on Thursday June 30, 2011 @10:40PM (#2716766)
I wasn't advocating this method or defending Mt. Gox. (Their touting of SHA-512 and use of the unclear term 'triple salted' raises red flags.)

I was providing an example of what could be meant by 'triple salting' that didn't necessarily involve 'three servers'. We could contrive scenarios where bcrypt with this multisource-salt would be a win over bcrypt with a single same-database salt. Intellectually exploring the problem and solution space requires more than just slavishly repeating the already widely-known 'standard methods'.

Have we worked together at a level that would help you assess my level of knowledge, and the sources thereof? I don't recognize your name/handle.

Re:Those 500K Bitcoins that caused the flash crash weren't real by uxp on Friday July 01, 2011 @12:04PM (#2718860)
No, we haven't worked together. My "cursory knowledge" comment was more directed at the people running MTGox, not you. Sorry if I phrased it in such a way to imply so.

I agree, there could be an implementation where applying multiple salts might have a benefit, but SHA-512 is not that implementation. I was not slavishly repeating 'standard methods', but pointing out that they are or were widely wrong in whatever they were doing to begin with. An MD5 is hilariously weak for password hashing, and salting an MD5 only makes an extremely weak password hashing scheme moderately weak. It honestly sounds like they took the first hashing implementation with the largest number tacked on the back of it that came to mind and called it good. This is not the right thing to do, and anyone that 1) cares about the security of their online web app's users information, and 2) has spent more than 2 minutes reading about the correct ways to secure an online web app, should be able to figure this out.

Point being, the fact that they originally only had MD5, and then "upgraded" to a salted MD5, and now are going to a triple-salted (whatever that means) SHA-512, is a BIG clue that they really don't know what they are doing, and a complex homebrew triple salt implementation that passes a password to 3 different places to be salted is bound to be broken. Unless they have hired a well known experienced cryptographer, I wouldn't trust MTGox with a dime of my internet money.

Re:Those 500K Bitcoins that caused the flash crash weren't real by gojomo on Friday July 01, 2011 @06:59PM (#2720485)
We agree on Mt. Gox's hand-waving, and also that intent in threads can get confused. I appreciate the apology.
Re:Those 500K Bitcoins that caused the flash crash weren't real by Jach on Thursday June 30, 2011 @09:26PM (#2716572)
That's very clever. Though I doubt this is what Mt. Gox is actually doing...
Re:Those 500K Bitcoins that caused the flash crash weren't real by owenmarshall on Friday July 01, 2011 @09:31AM (#2718230)
That idea is absolutely not clever. It's a system that would be difficult to implement, fragile, and most importantly would provide almost no added security.

Programmers: shut the fuck up and use a well known password derivation function. Stop the NIH wanking -- homebrew cryptography is about as useful as seeing the local witch doctor for a heart attack.

Re:Those 500K Bitcoins that caused the flash crash weren't real by daeken on Friday July 01, 2011 @08:37AM (#2718018)
There are plenty of ways that you could use 3 different salts without it having to pass through 3 servers, but I was specifically responding to the OP, where he spoke of 3 salts in 3 different servers.
Re:Those 500K Bitcoins that caused the flash crash weren't real by gojomo on Friday July 01, 2011 @02:09PM (#2719455)
Yes, I should have addressed my example more specifically to the seanalltogether parent comment's assumptions.
Re:Those 500K Bitcoins that caused the flash crash weren't real by wiredfool on Thursday June 30, 2011 @08:13PM (#2716320)
Triple salt sounds bad. Should be Salt, Pepper, and Cayenne.
Re:Those 500K Bitcoins that caused the flash crash weren't real by rheide on Thursday June 30, 2011 @07:50PM (#2716260)
How so? Seems to me like it could mean any number of things, all of which succeed in securely hashing+salting a password.
Re:Those 500K Bitcoins that caused the flash crash weren't real by daeken on Thursday June 30, 2011 @08:10PM (#2716308)
They could be using 3 different salts, each of which is statically stored on the server. They could be using 3 per-password salts, and applying each of them once. They could be....

At the end of the day, salts are there for one thing alone: eliminating the possibility of rainbow tables. But whether you use 1 salt of decent size (64-bit minimum for that) or 1000, you've got the exact same protection there. There's a good reason it's recommended that you use PBKDF2 or bcrypt.

Re:Those 500K Bitcoins that caused the flash crash weren't real by eric-hu on Friday July 01, 2011 @01:46AM (#2717188)
Doesn't a salt just make a rainbow table attack more expensive, in direct relation to the length of the salt?
Re:Those 500K Bitcoins that caused the flash crash weren't real by yaakov34 on Friday July 01, 2011 @03:47AM (#2717430)
No, it doesn't. Once the salt is large enough that you don't have several passwords hashed with the same salt value, there is absolutely no further advantage. Frankly, 64 bits of salt seems like enough for anything. Triple-salting sounds like a technique made up by an amateur who doesn't understand what salting is supposed to do.
Re:Those 500K Bitcoins that caused the flash crash weren't real by by on Friday July 01, 2011 @07:12AM (#2717818)
"The length of the randomly generated salt shall be at least 128 bits."

nist-sp800-132.pdf http://csrc.nist.gov/publications/PubsSPs.html

Not quite the same application, but it would seem best to take a conservative approach and make your salts 128 bits because the storage required is so small - you are only storing one per username.

Re:Those 500K Bitcoins that caused the flash crash weren't real by yaakov34 on Friday July 01, 2011 @01:01PM (#2719130)
Right, but this doesn't make the search space 2^64 times larger, or anything of the sort. Once you've assigned a unique salt to every password, you're not getting any further benefits from salting. This is what the Mt. Gox owner doesn't seem to get, with his "triple-salting".

The NIST application involves generating keys from passwords, which you might do a gigantic number of times for every password to get unique sessions and so on. They're not talking about password storage. And even then, 128 bits seems like a huge overkill, which was included just because it's cheap, so why not. I don't mind 128-bit salts, but let's not promote that as some "ultra-secure" feature, which it isn't.

Re:Those 500K Bitcoins that caused the flash crash weren't real by tzs on Friday July 01, 2011 @01:50AM (#2717195)
Security is hard, and we KNOW they are not experts in this area. The ONLY way they can do a secure system is to use someone else's design.

Thus, the fact that they are describing it in terms that none of us have heard of is a troubling sign.

Re:Those 500K Bitcoins that caused the flash crash weren't real by bcl on Thursday June 30, 2011 @10:41PM (#2716773)
1st rule of cryptography - don't try it at home. You'll get it wrong. There are any number of standard ways to protect passwords, there's no need for them to be reaching for the bottle of Snake Oil.
Re:Those 500K Bitcoins that caused the flash crash weren't real by boyter on Friday July 01, 2011 @06:25AM (#2717737)
Rocky Heckman who is a security specialist as Microsoft http://blogs.msdn.com/b/rockyh/ summed it up in the best way I have heard so far.

"Don’t write your own Crypto algorithms unless you have a Doctorate in Cryptography."

Re:Those 500K Bitcoins that caused the flash crash weren't real by khafra on Friday July 01, 2011 @08:44AM (#2718037)
I think Thomas Ptacek takes it a necessary step further: "Don't implement crypto." Even if you're using a good algorithm, your implementation of it will have holes. The trouble is that the normal exploratory programming technique that gets a MVP up and running doesn't find security holes.
Re:Those 500K Bitcoins that caused the flash crash weren't real by cvandyck76 on Friday July 01, 2011 @02:10AM (#2717221)
Exactly. Security through obscurity does not work (for long, at least).
Re:Those 500K Bitcoins that caused the flash crash weren't real by spc476 on Thursday June 30, 2011 @09:05PM (#2716511)
Why not use client-side certificates to log in? Or at least use a client-side certificate for anyone that works at Mt. Gox.
Re:Those 500K Bitcoins that caused the flash crash weren't real by drivebyacct2 on Thursday June 30, 2011 @10:24PM (#2716728)
Yeah, when this very first happened, I was in the IRC room at onlyonetv interviewed Mark (via proxy). I kept shouting in IRC to ask them to use bcrypt and was told they were doing 1000xSHA-512. I later tweeted at MagicalTux to recommend bcrypt and was asked if multiple iterations of SHA-512 is good enough. He said that he was told bcrypt was not secure enough.

How do these businesses succeed with business people that have no business wit about them, have NO ability to communicate effectively in these critical situations and have awful taste in technical advice?

Google "bcrypt sha-512 hash passwords" and tell me if it's a hard call to make. You should have heard these guys within the first 36-hours answering questions. Even the business guy over at TradeHill, "Well, you know after mtgox, we need to do a lot to beef up our security". Even if that's a true statement, what a ridiculously terrible way to phrase it.

I think speech and debate classes should be required for everyone to graduate highschool, let alone college. People aren't good at thinking on their feet and speaking in critical situations where wording makes a difference.

When you're in the business of being an online bank for an uninsured (nearly) untraceable currency, mis-speaking like this costs you your most important asset: TRUST. That's not even touching the tip of the iceberg of lies and misinformation that has come out of mtgox.

Anyone that leaves a penny in any mtgox account is an idiot.

Re:Those 500K Bitcoins that caused the flash crash weren't real by puredemo on Thursday June 30, 2011 @10:32PM (#2716747)
>How do these businesses succeed with business people that have no business wit about them, have NO ability to communicate effectively in these critical situations and have awful taste in technical advice?

They take off because they are excellent, useful and timely ideas. Unfortunately, people who have strong, timely ideas, like this one, frequently aren't able to find good technical co-founders, probably because of the "ideas are worthless" meme so many hackers love to recite nowadays.

So the ideas take off anyway, but the sites basically don't have the technical architecture that they should and have to be rewritten later.

Re:Those 500K Bitcoins that caused the flash crash weren't real by sunchild on Friday July 01, 2011 @04:18AM (#2717489)
It's a shame that they can't be bothered to learn about security, since they're in the business of holding other people's money. It seems that they have killed their amazing opportunity, and deeply harmed the public's confidence in bitcoin at the same time.
Re:Those 500K Bitcoins that caused the flash crash weren't real by rms on Friday July 01, 2011 @04:19AM (#2717491)
No, it seems to have gone fine. A lot of people (including Mt. Gox) decided to start taking security more seriously, and the price of Bitcoin has increased slightly.
Re:Those 500K Bitcoins that caused the flash crash weren't real by sunchild on Friday July 01, 2011 @06:21AM (#2717727)
"No, it seems to have gone fine."

You really think so? I find that statement sort of amazing. I guess ever the optimist, right?

Re:Those 500K Bitcoins that caused the flash crash weren't real by alsocasey on Thursday June 30, 2011 @11:20PM (#2716884)
Ideas are worthless refers to the fact that an obvious thing is obvious - I would argue that most ideas that go on to become successful products are obvious. Seldom are they really revolutionary. The implementation might be, but the idea itself seldom is.

In the current case, well just because it isn't perfect from a technical standpoint, doesn't mean it wasn't the best execution of the idea out in the wild...

Re:Those 500K Bitcoins that caused the flash crash weren't real by yuhong on Thursday June 30, 2011 @11:29PM (#2716910)
Don't confuse SHA-512 hashing once with SHA-512 hashing 1000 times though.
Re:Those 500K Bitcoins that caused the flash crash weren't real by bradleyland on Friday July 01, 2011 @10:36AM (#2718481)
No one is confused. SHA-512 is designed to be very, very fast. I just ran a very rudimentary test comparing SHA-512 and BCrypt with these results.

BCrypt 1000 iteration test script: https://gist.github.com/1058610

# => That took 76.370953 seconds

BCrypt 1 iteration test script: (same as above but with `1.times do`)

# => That took 0.074209 seconds

SHA512 1000 iteration test script:

# => That took 0.004092 seconds

SHA512 at 1000 iterations is over 18,000 times faster than BCrypt at similar iterations; which, by the way, makes no sense to do.

BCrypt has a "cost" factor, which is used to adjust the computational complexity to your use case. This is why BCrypt makes so much more sense for password encryption than something like SHA512. Running SHA512 n times is just a cheap, ineffective imitation of BCrypt.

Re:Those 500K Bitcoins that caused the flash crash weren't real by jsprinkles on Thursday June 30, 2011 @09:29PM (#2716582)
What is the benefit of bcrypt over several million rounds of SHA-512? It seems to me that repeating the hash function is the adjustable work factor that bcrypt seeks to allow and SHA-2 is already in most languages without an additional library.
Re:Those 500K Bitcoins that caused the flash crash weren't real by rmc on Friday July 01, 2011 @05:21AM (#2717620)
What is the benefit of bcrypt over several million rounds of SHA-512?

Most advances in cracking cryptographic hashes is not from Moores law, but some insight or breakthrough in the underlying algorithm. i.e. someone figures out a way to make MD5 brute forcing 2^(lots) faster. Usually these are not done overnight, but are chipped away bit by bit.

We are getting there with SHA512. The edges are starting to give. Warning signs are apparent. Eventually someone will reduce it to nothingness. 1000 iterations of nothingness is nothing ness.

SHA-2 is already in most languages without an additional library.

Oh dear god this is a terrible way to make a security decision. You have to install software no matter what you do. Unless you're writing software with a magnet in raw machine code, you will have to install additional software. Take the few minutes to install the bcrypt library.

Re:Those 500K Bitcoins that caused the flash crash weren't real by idlewords on Thursday June 30, 2011 @11:14PM (#2716865)
When talking about DIY crypto, the question should be turned around - what's the benefit of this over just using bcrypt?
Re:Those 500K Bitcoins that caused the flash crash weren't real by pnathan on Friday July 01, 2011 @10:23AM (#2718435)
Well, one example might be if you were implementing your crypto in a language that doesn't have bcrypt bindings.

So you would either have to port bcrypt or use existing crypto code to approximate bcrypt-level security.

Re:Those 500K Bitcoins that caused the flash crash weren't real by maaku on Saturday July 02, 2011 @12:36PM (#2721856)
False choice. Why roll your own when either porting bindings to bcrypt or porting the bcrypt implementation to your language is easier and safer?
Re:Those 500K Bitcoins that caused the flash crash weren't real by Locke1689 on Thursday June 30, 2011 @11:30PM (#2716912)
No. Making Blowfish faster is equivalent to solving a hard cryptographic problem. We have a much weaker guarantee about SHA-512. While SHA is probably good enough, bcrypt is definitely better.
Re:Those 500K Bitcoins that caused the flash crash weren't real by tedunangst on Thursday June 30, 2011 @09:47PM (#2716642)
Not much. You are perhaps a little more likely to find super-tuned GPU/FPGA implementations of SHA2 than pessimized blowfish, but it's not inconceivable for someone to write the latter. bcrypt is easier to pronounce than PBKFD2.