(Mar 30, 2016 07:54 PM)resent Wrote: Then what's the point? If someone has access to your server to view all of the files, they have access to all of the private keys.
It's like having a safe but having the combination written on the door in big clearly readable letters
Maybe I'm missing something, but I don't think the keys are saved on the server at all. It sounds like the only copy of the key was given to the uploader in the URL so they could share it with people, that's assuming that the server owner isn't secretly logging all the keys. However, because SSL isn't in use, the key is basically useless due to the fact that anyone monitoring the network can see it.
So, to use your analogy, it's like having a safe but whenever someone puts the combination in, they also shout it out loud at the same time.
Unless the web server has full access logs (thus logging the keys),
I think this service would be quite secure from someone breaching the server and stealing the files[SEE MY EDIT], but not particularly secure for the people actually downloading/uploading stuff.
This site relies on trust that the server owner isn't logging the keys, but that's the case for a lot of services that don't have end-to-end encryption.
The site does actually have a working SSL certificate so you just need to put https at the start of the URL, but for some reason it doesn't force people to use it or even suggest people use it.
Update: I noticed the code is on Github so I've been looking through some of it. I've only looked at two files so far and have already found a couple of things that concern me:
Code
var key = Math.random().toString(36).substring(6);
That is the code that generates the key. Math.random() is
NOT secure for anything related to encryption, it's not very random, in fact, it's pretty predictable.
Secondly, when the file gets decrypted, it's stored on the disk in plain text, gets sent to the client, and then the plain text version is deleted:
Code
encryption.decryptFile(req.params.filename, req.params.key, false, function(tempfile) {
.......
encryption.removeFile(tempfile);
There's a few reasons why this is a serious problem:
A) What if the server loses power before the tempfile is deleted, or if the code throws an exception/crashes? Then it will stay in plain text permanently on the server.
B) Computers don't actually delete files immediately so there'd be recoverable plain text content all over the disk, just run a recovery program and a bunch of files will be readable without even decrypting.
C) If a malicious user somehow gained access to the server, they could just make a script to copy all the tempfiles to somewhere permanent when they get created.
Basically, the encryption is useless. Sorry, didn't mean to shit all over your site, but it really needs some more work doing to make it properly secure.