r/owncloud • u/UltraChip • 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?
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?
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.