281 points · by bavidar · 13y ago · 258 comments
8. Our service may automatically delete a piece of data you upload or give someone else access to where it determines that that data is an exact duplicate of original data already on our service. In that case, you will access that original data.
Duplicate check, I get that. But, how do they do it? They say the files are encrypted on the browser, so if I upload file X and other user uploads X too, they can't know they're the same because both uploads are encrypted. So, they can check only for duplicates of the encrypted outcome of each file. But, wouldn't that be inefficient? Probability of collision in encrypted files is (AFAIK) really low, something like 2^(-N), N being the size of the file on bits... If I did it well, it'd be a collision probability of 7.458E-155 for a file of 1MB.
EDIT: Added example.
https://mega.co.nz/#developers
Apparently, they use unsalted symmetric key encryption which allows them to discover [hash(file), password] duplicates. By comparison, the old Megaupload would apparently deduplicate based on [hash(file)] matches.
Suppose Alice and Bob have files [D, E, F] and [F, G, H], respectively. If MEGA discovers that Alice and Bob share a duplicate file F and Alice to reveals her password (through password frequency analysis or to the Government), then all of Bob's files are compromised.
I would personally feel unsafe storing private documents on Mega due to the lack of public/private key encryption, but that's me.
It is probably worth pointing out that all of this encryption stuff is only for them. Nomatter how they brand it, the purpose is to give them plausible deniability, which they lacked with the previous Mega.
If you want encryption meant for you, then you should probably just encrypt your files yourself before you let Mega touch them.
The document does say it uses public/private keys for data transfer. You would not usually use public/private for data storage because of the huge keysizes required.
If they use asymmetric encryption for data transfer, then how does that work as part of a convergent encryption scheme? Wouldn't all of the file hashes be different at that point?
It seems really interesting, so they can check for duplicates while keeping files secure. Thanks!
"However, one more attack: an attacker can guess plaintexts and test if you have that file."
If that's the case, pirates beware.
Edit: GNUet quote:"The gnunet encryption scheme is remarkable in that it allows identical files encrypted under different keys to yield the same ciphertext, modulo a small block of metadata. These files can then be split into small blocks and distributed (and replicated if need be) across hosts in a gnunet system to balance load."
http://grothoff.org/christian/esed.pdf Efficient Sharing of Encrypted Data - Krista Bennett, Christian Grothoff, Tzvetan Horozov, Ioana Patrascu
They wouldn't really want that, would they? So as clever as it is, I doubt they do it this way.
The thing with copyrighted content, though, is that even if the file you're checking might be infringing on copyrights in certain cases, in other cases it might as well be completely legit. I wrote about this on some earlier MU submission[1], so I won't repeat all that here, but all in all, even if you knew that file X existed on Mega's servers, it would be pretty damn haphazard to just outright delete it, because you might be hurting many legitimate users by doing so.
Anyway, I think Mega could secure user's files simply by encrypting the locator keys they have with the user's own key, and this data only gets decrypted and parsed client-side when the user uses Mega with the user's own key. This way you could only prove that a file exists on Mega's servers, but had no way to check which user(s) it belongs to without cracking the individual user data one by one. And of course, if you don't have any exact files to check against Mega, then you wouldn't be able to even figure out whether "content X" is hosted there somewhere, and neither could Mega (since they'd naturally only store locator hashes and encrypted data itself).
Example: Alice and Bob both upload the same file to Mega. Alice is raided by the MAFIAA. They get a court order telling Mega to list all users having a copy of that file. Can Mega comply? Or does not even Mega know that Bob has the same file too?
Related question: Is there any way for Bob to share his uploaded file with friends?
The idea is simple: if you have data, then you can generate the key from data itself to encrypt and decrypt than data. Then you use hash of encrypted data to look up if server (or just other side) has the same data. If hash exists, no need to send to server - just tell server to bump references. If hash does not exists, just upload data. The key derived from data needs to be stored locally - if you lose it, you will lose data too.
key = f(data);
upload(encrypt(data, key));
store_key(filename, key);
Which is to say that every file has a globally 1-to-1 mapping to its encrypted version. I'm not sure how they are storing the (User, [(Filename,Key)]) data, but this is ideally encrypted on a per user basis, making any sort of per-user lookup attacks moot.
Encrypted data is indistinguishable from random data, so it is incompressible. The chances of finding anything significant to deduplicate are so low that it's not worth trying.
For that reason, when ever I'm sharing anything I usually encrypt files with my recipients public keys before sending those out. Just to make sure that data is really private and keys are known only to my selected peers. In some cases when I want to make stuff even more private, I encrypt data separately with each recipients public key, so you can't even see list of public key ID's which are required to decrypt the data.
I also have 'secure work station' which is hardened and not connected to internet. That's the workstation I use to decrypt, handle and encrypt data. Only encrypted and signed data is allowed to come and go to that workstation.
Not sure I understand this, how can you deduplicate if every file is encrypted via a random key?
Then, on the user side, they store an per-user encrypted index (random, counter, MAC) to those individual chunks to represent the file.
That way, they can only see giant encrypted blocks of data, and per-user encrypted indexes to data. But it is all encrypted.
They would need to hack into accounts by keylogging passwords to decrypt the indexes and see what files users can actually access.
Public links could be shared by giving out a key in the URL that is a file containing indexes to other blocks. So whoever knows the URL, knows the index, and can get the data.
That is the way I'd design it, at least... :)
edit:typo
EDIT: They never get to see your key or what is in the file.
"File integrity is verified using chunked CBC-MAC. Chunk sizes start at 128 KB and increase to 1 MB, which is a reasonable balance between space required to store the chunk MACs and the average overhead for integrity-checking partial reads."
Also, if you believe Microsoft Outlook, there's something called "compressible encryption", which implies there are encryption schemes that aren't exactly random, meaning in turn that not all N-bit blocks are equally likely.
not to mention metadata associated with such a small block would be probably more than the size of the block itself.
However given a file Mega would be able to tell whether they stored that file, eliminating the plausible deniability they're aiming for.
They needed a way to deny any knolage of file sharing and have found a two pronged attack. The encryption means they can deny any knowledge of what they are serving, and marketing it as a drop box type tool means that they aren't marketing it as a blatant tool for illegal file sharing.
Doesn't the encryption make video streaming impossible in the way it was being done before (i.e. to a large psudononymous userbase)?
The service seems to have ground to a halt, and I am not able to upload anything, so perhaps this all becomes clear once one starts using the service, but I'm curious about how the encryption is used in practice.
Edit: Found a bit more detail in the developer documentation: https://mega.co.nz/#developers According to this, they use the symmetrical AES-128 to encrypt files, so why do I need an (asymmetrical) RSA key pair? It also says there that the private part of the RSA key is stored encrypted with the symmetrical AES key, but MEGA has that key, so what good does that do in case of an FBI raid?
One of the things that I was most curious about regarding MEGA was to see how they would manage to make encrypted file storage safe but user friendly. It seems like this is user friendly, but not safe at all, or am I wrong?
| Each user account uses a symmetric master key to ECB-
| encrypt all keys of the nodes it keeps in its own trees.
| This master key is stored on MEGA's servers, encrypted
| with a hash derived from the user's login password.
The key is stored encrypted on their servers, but is unlocked with your password. Technically they could capture your password and unlock the key, gaining access to the files.Unlocking a key requires a real password but the server knows only the hashed version. This way they can't capture the real password to unlock. The trick would be to make sure server always gets only the hashed password. Even at website login, the password must be hashed before sending!
We used similar crypto for http://timegt.com product where everything is end-to-end encrypted with a keypair generated by the user yet stored at the server. But it's stored at the server in a locked form that can be opened with a password that user entered. But this password is never sent to the server, only the password hash is and is used only to make sure that it's ok to send this locked key to the user. Hopefully this didn't sound too confusing now...
If the goal was actually to create something very secure, I would say that the keys would need to stay entirely on the client side, but this of course has its own usability problems. As it is, I'm curious as to how password resets can be carried out.
That being said, it's probably relatively secure as long as the cloud provider isn't raided or coerced to act badly. They can reasonably say that the data is encrypted and that they don't have access to the key.
I would be interested to see what the crypto looks like when the site is used for file sharing (e.g. I upload once, then post a link for many to download). Or am I just assuming that there's an option for this use case?
[1] https://mega.co.nz/#help_security
EDIT: The senario in the posts above sound more likely. The exact text of the help is "No usable encryption keys ever leave the client computers (with the exception of RSA public keys)." So they probably store an encrypted version of the keys server side.
How do other people access my stuff?
Doesn't work...
I agree with the sentiment, though, that this is security theater. It's subject to the same problem as Hushmail, where they could be forced to snoop on their customers by modifying client code.
[1] http://arstechnica.com/business/2013/01/mega-arrives-ars-goe...
They can store the encrypted key on their server and send the encrypted key to the client whenever the client requests it. The client decrypts the key locally and use the decrypted key to decrypt the data.
With this scheme, the user can use a client on any machine to download his encrypted key and use it locally.
So what if the service falls flat? I don't really plan to use it until the kinks are hammered out anyway. The fact that he got it out there though is a statement on to itself.
https://en.wikipedia.org/wiki/Kim_Dotcom#Criminal_investigat...
It's just hard for me to respect the man, because he's not fighting for information freedom, he's fighting for as much cash, status, and power as he can get his hands on.
Also, during the time megauplaod existed, there always were upload providers. Megaupload came quite late into the game.
Google and Co is also selling... your content whenever is legal or not
Torrent sharing is one thing. Selling access to downloadable material that doesn't belong to you quite another.
I completely agree that there is a distinction, and one I also feel strongly about. But really the only distinction between the pirate bay and megaupload from that point of view is maturity and technical/political savvy. I feel I have to draw the line at a place where selling access to a file locker that you know is mostly used for infringement is ok or I'm a hypocrite. Especially when you look at from a "what should be legal" point of view where you have to consider enforceability rather than a hypothetical ethical question.
Edit: They're not gzipping any of the 2.5MB in static resources either. I realise that probably doesn't impact their API calls that are failing, but it's still a big oversight.
Not using Gzip is obviously a big mistake.
I think this is the only time I would use the words "FTFY" on HN, but I do think it's obvious, that with kim's bragging about bandwidth usage, gzip has been disabled intentionally.
He could just as easily make up a fake bandwidth usage number for marketing purposes rather than actually put unnecessary load on his servers by not using Gzip.
It's most likely down to him hiring sloppy developers. And judging by the source code on the site this is exactly the reason.
The tie in with web hosting companies adds an ounce of legitimacy to the affiliate program that originally led sites like the defunct tv-links.co.uk etc to throw traffic at their paywall last time but it won't be even close to enough if tomorrow there's millions of mega links on all the streaming and download indexing sites.
This will be very interesting to watch unfold.
They say that this is their first Javascript coding; they should really get some talent on board to clean this up.
is this a joke? I'm on FF19
Further, the site looks very much polished in Chrome and its hard to find anything to blame for. If they did benchmark testing and realized Chrome works the best for decryption/encrypting/etc, I don't blame them for giving up on other browsers.
Chrome starts a lot slower for me. It seems to really hit the disk a lot more than Firefox.
Chrome supports this, Firefox does not. See my comments in the Mozilla bugzilla bug about this:
Basically, only Chrome seems to be supported because it is "the most advanced browser currently in existence"
File upload didn't work though....
btw thanks for the downvote, whoever that was.
Definitely a rip-off, and not a particularly well executed one.
For me, mega.co.nz is at 154.53.224.166, which is Africa allocated, administered by afrinic.net who seem to be on a small island off the coast of Madagascar.
cursor:pointer;
would have made a HUGE difference to the button itself and to the User's experience, clicking on it. Sigh, when will start-ups start paying attention to UX?Is it down, or is my ISP blocking the SSL certificates so I cannot use it?
I am using Google Chrome.
I assume the site was DDOS'ed or failed under heavy bandwidth.
Other links just failed for me. They definitely messed something up. Or I am missing something central here.
> 8. Our service may automatically delete a piece of data you upload or give someone else access to where it determines that that data is an exact duplicate of original data already on our service. In that case, you will access that original data.
EDIT: Spoke too soon
Edit: I'm trying to access it from EU if that makes any difference. Seems like http 500 error is returned for assets hosted on eu.static.mega.co.nz.
You can't share a link with the public anymore, only with an emailadres.
http://gizmodo.com/5977265/how-megas-encryption-will-protect...
which makes it no different to before, except this time they're hoping deniability is better than openly facilating piracy in their internal communications.
Seems like they can't handle the load.
MEGA reports: 500 B/s upload speed
:/
However, that's not how Mega works. They're still storing a symmetric key on their server. They're just encrypting before storing for deniability reasons. https://mega.co.nz/#developers
EDIT:
It's because AJAX return "500 server too busy" error.
>The Olympic motto is "Citius, Altius, Fortius." These three Latin words mean "Swifter, Higher, Stronger."
Fucker.
"Bigger. Better. Faster. Stronger. Safer. Thanks Daft Punk for all the music!"
Daft Punk sold out by their second album anyway, they're hardly underground geniuses in want of credit now.
Nonetheless, I think it's just more grandiosity and find it irritating that he riffed on the chorus at all.