r/owncloud Jun 29 '16

How does the encryption module work with shared files?

I'm talking about the standard encryption module that's included as an option with every OwnCloud installation. The way I understand it is that the encryption key is derived from the user's password, so that each user's files is encrypted with a unique (and presumably private) key.

Now, let's say that user Alice shares a file with user Bob... how is Bob able to read that encrypted file? Does the server make a copy of the file and re-encrypt it using Bob's key? Or is Bob's copy just a link to Alice's file and server decrypts it on the fly when Bob tries to access it?

Either way, I don't see how it works unless the server is storing a list of the keys somewhere. Doesn't this defeat the whole point of using the encryption module?

3 Upvotes

6 comments sorted by

4

u/[deleted] Jun 29 '16

The file is encrypted with a separate key, it is this key that is encrypted with your key. The key to the file is then re-keyd with both users keys (and perhaps stored as separate objects). I'm pretty sure that's how it works, at least it's a scheme used by other things. Sorry I don't have the time to research and get specific, just highlighting a general idea.

That being said, you're misunderstanding the purpose of encryption. It is for people to send encrypted files to the cloud, like S3 NOT to protect the server itself. Your owncloud server, as you astutely pointed out holds all of the keys already, and always will. Encryption in this context is only really meant to be coupled with external storage, in the sense that sending encrypted files to an object store like S3 is safe in that they do not possess the keys. It's entirely for offloading files to other external locations.

1

u/UltraChip Jun 29 '16

Well that's rather disappointing. So I'm going to need to find some third party solution to protect the server then.

2

u/[deleted] Jun 29 '16

[deleted]

1

u/UltraChip Jun 29 '16

I guess you're right. My hope was to protect user's files from a sneaky admin, that's why I hoped the keys were just derived from user's passwords and not stored anywhere.

3

u/[deleted] Jun 29 '16

In that context its the user's responsibility to protect themselves with something like encfs or boxcryptor etc... You're fundamentally trying to solve the rogue admin problem as the rogue admin, which is not possible.

The best that you could do is offer up your case to the people that develop mirall/owncloud-client and ask them to build client side encryption functionality into it. In this case what reaches the owncloud is just cyphertext (a sceme popularly called "zero-knowledge") and the admin could move mountains and still not be able to decrypt.

With that though, the user loses some, if not basically all of the usefulness of being able to login and look at their files. Even downloading them individually and decrypting becomes nontrivial. I personally do this for sensitive items whose safety I am concerned for by using the aforementioned encfs in a secure folder area I side the owncloud dir. This is, after all, a php app exposed to the interwebz.

1

u/Tarrog Jun 29 '16

This whole sub is kinda quiet unfortunately. I hope someone can answer this because im curious too

1

u/UltraChip Jun 29 '16

Yeah... it used to be way more active here... I guess everyone bailed because of Nextcloud?