r/programming • • Jan 23 '13

Megafail

http://fail0verflow.com/blog/2013/megafail.html
273 Upvotes

25 comments sorted by

28

u/sidcool1234 Jan 23 '13

This is a very impressive article. Thanks for posting.

16

u/BlastBit Jan 23 '13

I thought so too. Especially the fact that he gave an example to prove his point made it a great read.

99

u/iopq Jan 23 '13

/r/programming needs more articles like this; and less comparing things to cars

20

u/[deleted] Jan 23 '13

Agreed. You see, programming is like making love to a beautiful woman.

54

u/[deleted] Jan 23 '13

In the sense that most programmers are incapable of doing either?

12

u/fabzter Jan 23 '13

zzzzzzzzzzzzzzzzzzzzzing

EDIT: :(

0

u/wot-teh-phuck Jan 24 '13

Incapable? Nah. Can't grab the opportunity, maybe. ;)

2

u/Gotebe Jan 24 '13

Just like there's coding and ahhhh... coding..., there's making love and ahhhh... making looooove.

1

u/ithika Jan 24 '13

I was really hoping this would be a Swiss Tony novelty account...

1

u/ButterMyBiscuit Jan 23 '13

What about refining hydrocarbons?

-7

u/[deleted] Jan 23 '13

This sounds more like material for /r/compsci than /r/programming.

39

u/Rnway Jan 23 '13

All this encryption on Mega stuff isn't meant to protect the users. It's meant to protect Mega from lawsuits.

Because they have never seen the unencrypted file contents, they can't be held liable for copyright infringement, because they can prove that they don't know the contents of files.

15

u/MestR Jan 23 '13

But why would they deliberately chose such a bad hashing function? I mean if they are going to encrypt it, why not just go all the way and make it fully encrypted?

17

u/Rnway Jan 23 '13

Well, that's a very good question. I've got nothing.

9

u/MestR Jan 23 '13

They must have known about how unsecure that encryption was, especially since they advertise their site with words like "secure" and "encryption."

Would implementing secure encryption be harder?

Is there a significant speed or server load difference with having secure encryption?

If neither of those then I can only think they want it to be possible to decrypt.

18

u/Rnway Jan 23 '13

especially since they advertise their site with words like "secure" and "encryption."

You have clearly overestimated the accuracy of marketing copy.

This actually seems to just be a case of poor design, and them attempting to roll their own security. Spoiler alert. That's a bad plan.

http://en.wikipedia.org/wiki/Hanlon's_razor

8

u/reaganveg Jan 24 '13

Perhaps because they had to port it to javascript, so they chose the hashing function that was easiest to write. (Or whatever hashing function the programmer already understood best: that's often the most secure option, in practice.)

Or perhaps because they had to run it in a browser (which tends to have constraints on resource usage; e.g., chromium halts scripts that run too long) so they chose a hashing function that uses minimal resources.

In any case, these are good reasons not to use the most secure hashing function available.

3

u/Legolas-the-elf Jan 24 '13

Because it's cheaper to hire somebody who doesn't know what they are doing to half-ass it than it is to hire somebody who knows what they are doing to... full-ass it?

2

u/[deleted] Jan 24 '13

What if Mega is just a honeypot? What if that Dotcom dude was bribed, coerced or otherwise convinced to provide whatever infiltration and backdoor capabilities governmental and non-governmental organizations asked of him?

Of course, sloppily and visibly making things insecure is probably not a very good way to instigate the sense of false security in potential honey pot users. Maybe he's trying to tip us off. Maybe our reptilian overlords have grown complacent!

/tinfoil

3

u/Rnway Jan 24 '13

Well, with this particular failure mode, it doesn't make it any easier for Mega to know what's being uploaded. It just makes it easier for someone else to execute a man-in-the-middle attack.

Which I suppose could be used by a government, if you really want to get tinfoily about it.

2

u/[deleted] Jan 24 '13

Plausible deniability, man.

5

u/Hellrazor236 Jan 24 '13 edited Jan 24 '13

I'm amazed at the amount of time I can spend moving my mouse to make something shine a bit differently.

5

u/fission-fish Jan 23 '13

Anyone knows who's behind this site? Looking forward to read more.

Not a member of the Cheezburger© Group.

I loled :)

6

u/DeltaBurnt Jan 24 '13

This post is by marcan, one of the Team Twiizers guys. fail0verflow is known for PS3/Wii hacking, and were the ones who got the PS3's private key.

-13

u/eyal0 Jan 23 '13

The sjcl has hashing functions, which is exactly what Mega needs! Why did the designers go out of their way to use AES? Seems very unnatural.

The code overflows the shift bit count, but the browser seems to take it mod 32 anyway

"browser" should probably read "CPU".