Screenshots of upcoming Mega site: key generator, registration, and file manager
thenextweb.com
thenextweb.com
But for this site to be popular enough to allow for downloads supported by ad revenue, then the file links and decryption keys will have to be widely distributed to drive traffic. If someone files a takedown notice with a file and decryption key that proves the data contained therein is copyrighted then won't MU be in the same boat they were in previously?
Presumably mega then don't offer a site search but instead rely on google to index warez forums with links to the site that include the decryption key. I don't know.
Edit: found the site that did this: http://news.ycombinator.com/item?id=3852649
Ultimately I shut down the site as it got very little traction.
Unless they use random numbers supplied by Mega itself, I just don't see how that would work. If they are using entropy supplied by Mega, then they might as well not bother with the whole encryption thing.
ED: The screenshot does mention that they gather entropy via keystrokes and mouse movements (like modern OS do), but I'm still not sure that would provide anywhere near the randomness needed.
The WebCrypto proposal includes a CSPRNG -- I believe it's now implemented in Gecko and/or Webkit (don't recall which one I saw). However, the bigger concern is that the JS is coming from their servers, which means it's completely compromised by default.
As they explain it, they use a private/public key encryption in which the server has the private key and the encryption occurs with a public key. Only the private key on their servers can decrypt the file.
Could they be using something similar where you generate your own large (2048 bit) key and use that repeatedly for each file that you upload? Could they allow the user to supply their own cryptographic key that can be generated with local tools like openssl?
I'm no cryptography expert, I'm just curious what they could do to make it more secure.
Users could use OpenSSL to make their own strong keys, sure, but if they were they might as well use a local client application (which Mega will probably have).
The alternate would be to store a strong private key in localstorage and use that for encryption, though I'm not sure how you'd sell that to the users.
(There are several reasons; symmetric crypto is faster, and there are attacks on asymmetric algorithms based on the plaintext encrypted. Using random key data as the plaintext for the asymmetric algorithm prevents those attacks.)
So, even for asymmetric cryptography, a good source of randomness in the browser is an essential part of good crypto. Exposing a randomness source is probably the easiest thing for the browsers to solve -- key management/key storage, code integrity, the DOM, etc. are the more fundamental issues.)
I know that you choose p and q by random. And it is obvious that you want to choose numbers that an attacker can't easily guess. But not having access to a hardware number generator doesn't automatically imply you have a real useable vulnerability here, or does it?
Edit: To clarify, primes for RSA keys are generated probabilistically -- we don't really know that they're prime, we just have a fair amount of confidence to that effect. It's entirely possible to generate bad 'primes' that really aren't prime at all, which makes factoring the keys trivial.
You never want to implement something like this yourself for a real product, of course, but i don't see that specific issue. They even could build upon something like jsbn[1]
I thought that this is about a missing random number generator.
Either way, that's by no means the biggest issue here -- some browsers already have CSPRNGs -- but rather that the code is coming from their server and is considered to be compromised by default. Browser-side crypto without very strict security boundaries on key generation and access is just bad news.
It's essentially bad because the generated secret keys are predicable, to the point where a single CPU could crack them in minutes, which is obviously undesirable.
To do such an attack based on the pseudo-random-number-generator, someone on the outside of the key-generation-process would need to be able to guess the prime-numbers used on a specific account just by the predictability of the rng. How should that work?
Again, if having the choice, I will always use the conservative option when dealing with crypto-stuff (using an approved crypto-library). And really: Not saying what you say is wrong. Just don't see the attack-vector here. Would you like to give me a hint?
Through the sign up process try ask for users to both enter information with the keyboard, and click buttons with the mouse. There's not a whole lot of randomness in either action, and relying on it too much could start to reveal things about the user in the encryption key generated.
For this, lets assume I can predict the random numbers with minimal computation. That's realistic. PHP session variables can have their random seed extracted in a very short time frame using similar methods (<30 minutes).
They would first be relying on the randomness of the path that users take with their mouse between buttons. That's unfortunately fairly predictable, most of the users will click on the buttons in the same order, and probably take reasonably similar paths to get there. If we could work out the probabilities, the key search could be focused on the most likely path a user might take.
So we move on to keystrokes. There's not a whole lot of variation there either. If we use the keystrokes themselves, we might begin to reveal personal information in the key. I'm sure you wouldn't want your password baked into the keys you are relying on to protect your freedom / anonymity. The length of keystroke is what they would use, how much time the button stays down and the distance in time between keystrokes. There's some randomness there, but I wager that most people type with the same sort of characteristics. If they're on a touch screen device like an iPhone, you get no real timing information except for delay between letters.
There's no denying that it is still brute force and very unlikely, but using attacks like that could be the difference between decades of computation and hours
I already agreed that sure, if you can guess the prime-numbers because of a flaw in a rng, that is a serious issue. But I don't see how it follows that if you use javascript for the key-creation it is guaranteed you will use a rng with predictable outcome, especially not if you use user-input like described in the screenshot.
[1] http://blog.cryptographyengineering.com/2012/03/surviving-ba...
Actually, all the screenshot is showing is Javascript-based entropy gathering. It does not demonstrate that any of the other steps are necessarily done on the client.
Do you trust them?
You do. (Or in reality, the whole world since the point of Mega is to share files.)
Do you trust them?
Depends.
That implication makes no sense to me. Why would you ever share a private key?
The trust question is more about public keys. Do you trust that the key you think is your friends public key really is? And that's what key-signings are for.
The screenshot shows in-browser key generation but there's no reason I can think of that they should not accept keys generated by GPG or similar. Generate your keypair as securely as you can and however you like--and then only submit your public key to the Mega site.
Do you trust that that copy of The Dark Knight Rises is really from who you think? Who cares?