Purpose of Nextcloud Encryption

I have recently installed a Nextcloud on a server run by a commercial hosting provider. To have the highest security available, I have also activated Encryption which is directly available from Nextcloud.

As far as I understand it, Nextcloud encrypts contents of files once stored on the server. The encryption key is also stored on the server somewhere in the data directory (which obviously makes sense, because if the key were not available on the server, the data could not be encrypted there).

However I do not understand the purpose of this encryption setup. If someone (e.g., my hosting provider) gains access to the files on the server, they also gain access to the encryption key. Therefore they are also able to decrypt the files and hence the decryption can be omitted in the first place.

What am I missing here?

This encryption is for external storage, e.g. you have your Nextcloud instance and you use a S3 storage at hoster xy. You don’t trust this hoster xy, so you upload only encrypted data and store the keys locally on your server. So this hoster xy only sees encrypted data on the S3 storage without the keys.

That’s right, since encryption and decryption is on the server, you must trust the admin of this server. In such a case, you can use end to end encryption where the encryption/decryption is done client side. Nextcloud has an implementation for their clients (not sure how reliable this is in the meantime), or you can use any other 3rd party solution.

3 Likes

@simon-forb This depends on which encryption you use.

With the server-side encryption with the master-key enabled you are right. As soon as anyone has access to the files and the configuration then they can decrypt the files. So this mode is only interesting for external storages.

With the server-side encryption with the user-keys enabled, the files are secured as long as there is no user session that is able to access specific files (as the key used to decrypt these files is protected with the user password).

With the client-side encryption (aka. end-to-end encryption) the files get encrypted locally by the Nextcloud client software and are only uploaded in an encrypted form. E2E prevents hoster/admin from accessing the file contents.

1 Like

Well, with all the mobile devices there is a high chance that you can sniff all the user’s passwords within little time. Therefore it is just for external storage, that has no knowledge of the keys and passwords.