client icon indicating copy to clipboard operation
client copied to clipboard

[Feature] Client-side file encryption

Open lasselasse opened this issue 13 years ago • 24 comments

Please add the capability for client-side file encryption to the sync client: All files transferred to/from the server are encrypted/decrypted on the fly using a password given by the user. This would be an optional per-sync setting in the client. (I envision a cute padlock symbol to mark entries that have this feature turned on.)

If we accept that file/folder names are not encrypted (the user needs to be warned about this!), the implementation should be fairly easy since there only needs to be encryption/decryption added to the upload/download streaming of the file data. File metadata is not affected and thus the update detection does not need to be changed. Also, the user would only need to be prompted for the password when file data is actually transferred.

Since most cloud storage does not support client-side encryption, this would be a quite unique feature ownCloud!

lasselasse avatar Jan 27 '13 00:01 lasselasse

Hm, I realize that just using a password is not a good idea because it could not be changed without re-encrypting and re-syncing all files. Also, if a user accidentally enters a different password, the file data would be "corrupted".

So I guess what we need is a file with a randomly generated encryption key (which has been encrypted with the password given by the user) in the sync directory. This file is created when the user creates an encrypted sync folder. This file needs to be sync'd just like a normal file would be since all clients need it. Changing the crypto password on a client would re-encrypt the key file and sync it to the server, no other files need to be re-encrypted.

To ensure that the user is using the correct password to decrypt an existing key file, there needs to be a way to check the decrypted key to be correct. I'm not a cryptography expert, so I don't know what's a safe way to do this. I guess it would involve adding to the encryption key file some kind of a hash/checksum... anyone?

lasselasse avatar Jan 27 '13 01:01 lasselasse

I am in favor of closing this as WONTFIX. There is plenty of 3rd party client-side encryption software around, from full-disk to directory encryption. No need to develop a (most likely inferior) solution. /cc @dragotin

danimo avatar Jan 27 '13 18:01 danimo

Stupid question: is there any end to end encryption support? I'm one of those security freaks with full disk encryption, and making sure that the files are also encrypted server would be very interesting.

tafinho avatar Jan 28 '13 09:01 tafinho

I am well aware of client-side encryption software, and this is what I am using at the moment: my home partition is encrypted with LUKS and the files I sync are compressed and encrypted into 7z archives (I tried to use fusecompress+encfs to sync individual files, but the sync client does not work well with larger number of files at the moment). For me, the advantage of build-in encryption in the sync client is primarily convenience, I would save on the additional encryption manual step and would reduce the danger of accidentally uploading an unencrypted file.

The importance of this feature proposal is more geared towards the "ordinary" user who doesn't know how to encrypt client-side and/or doesn't want to be bothered with the details. From my experience, many people are not even aware of the security issues of uploading their data into cloud storage. Giving them an easy option to do this would be an important feature of ownCloud. (Server-side encryption is not a solution to this problem, it rather creates a false sense of security, I think.)

I agree that we should not re-invent the wheel here. I'm not a Qt developer, but it seems there are already encryption libraries available for Qt, e.g. QCA.

lasselasse avatar Jan 28 '13 16:01 lasselasse

Client folder can be encrypted pretty easily using an encrypted partition. Client -> server communications are encrypted by the use of https(I believe). Server storage can be encrypted just like the client folder(with more plans in the making for 5.0 iirc). I believe this is more than good enough.

+1 danimo WONTFIX

mjkent avatar Jan 29 '13 04:01 mjkent

What I'm aiming at with this feature proposal is to have ownCloud become a cloud storage that people feel comfortable with storing their files in without having to trust whoever is running the server and/or what might happen to the files they have stored there.

Both ownCloud's build-in server-side encryption and encryption on the physical storage level on the server are not sufficient for this, as the keys are out of the user's control and a security breach of the server might allow third-partys to access unencrypted files. Only encryption that happens on the client is secure in that respect.

The need for this feature is there and commercial solutions are already capitalizing on it ("BoxCryptor", "mega" etc.). I'd really like ownCloud to be the open-source alternative in this field as well!

lasselasse avatar Jan 29 '13 16:01 lasselasse

Basically:

  1. encryption is hard to get right and would be a ton of work to have this in the client, we have a bunch of other problems before we could tackle this
  2. end-to-end encryption would break the web interface, and make the whole client and sync setup more complex.

@lasselasse @tafinho @mjkent If you want to have encryption and know your stuff, please contribute. Good pull requests are always welcome, and we are focused on more core problems right now.

jancborchardt avatar Feb 27 '13 13:02 jancborchardt

To have the same effect as client-side encryption, you could use owncloud (or any other remote sync service for that matter) with EncFS, and only sync the ciphertext directory. Not an elegant solution, but it would be a form of client-side encryption. The advantage of this approach is that the ciphertext file sizes are roughly the same as the plaintext file sizes, and if one changes you only have to upload that one file. Compare this to volume encryption, where if one file changes inside the encrypted volume, you'd have to upload the entire volume again, which could take a while and unnecessarily eat bandwidth.

Hainish avatar Nov 21 '13 21:11 Hainish

Yup. We clarified above why we can't/won't implement this, so I'm closing this. :)

jancborchardt avatar Nov 22 '13 10:11 jancborchardt

Server-side encryption isn't the solution if you cannot trust the server admin (or even the hosting company). Why should one need to install lots of other software in order to only have encrypted files on server? Also, solutions like EncFS are only available for *nix systems - not windows. The typical tools for Windows require double disk space (for unencrypted and encrypted files). You could also argue that proxy or TLS/SSL support isn't necessary, since one can easily tunnel everything using stunnel or ssh.

Being able to read them on server (e.g. using javascript) isn't really necessary and also opens another possible "security hole" since the server admin could just insert some malicious javascript (for obtaining the encryption key or password)

So I think this issue shouldn't be closed as wont fix, but lower priorized as a lot of people have interest in such a feature.

csware avatar Dec 21 '13 01:12 csware

@csware

Why should one need to install lots of other software in order to only have encrypted files on server?

  • because others already solved the problem
  • because it’s hard
  • because it breaks the web interface, which is one of our most important aspects

»Being able to read them on the server« IS really necessary and that’s a big part of ownCloud. We have limited time as it is, so it’s way better to use tried and true existing solutions for the client-side crypto which can be used on top of ownCloud.

jancborchardt avatar Dec 28 '13 18:12 jancborchardt

hmm. I fail to understand completely why we need to read the file on the server. But maybe I am overlook something.

Sure, we want to offer operations on files where the content needs to be read, such as showing a picture. But aren't most of these functionalities implemented using client/browser side JS ? So, if we consider the browser a client which is under users control and can be trusted, we could give it the key to decrypt the files, right? Is that feasible? If yes, it would make sense to have client side encryption.

dragotin avatar Dec 28 '13 19:12 dragotin

because others already solved the problem

No, there are no good (third party) solutions as I already pointed out. So, why not integrate their solutions into mirall?

because it’s hard

Nobody said that it's easy, cryptographic libraries exist. Building OwnCloud completely from scratch isn't easy, too.

because it breaks the web interface, which is one of our most important aspects

Who cares? Ppl. who want to use client-side encryption (which should be optional) will understand this.

if we consider the browser a client which is under users control

Wrong assumption. The browser gets its javascripts from the server.

csware avatar Dec 28 '13 23:12 csware

If mirall could use some kind of rsync algorithm for uploading only changes, one could use TrueCrypt files - which would also "solve" this issue (i.e. if you have a 1 GB truecrypt file and you only change 1 KB you don't want to upload the file again completely). native client-side encryption is still preferable.

csware avatar Dec 29 '13 16:12 csware

Server-side encryption only? I don't think this is reliable. We should be able to encrypt files on-the-fly when uploading files or, at least, we should have a plugin which decrypts files on access, we'd just have to use a file as a key or just typing a password. But client-side encryption is preferrable. We might encrypt using standard tools but how can we access those tools while using a phone, for example? If server-side encryption can be done, maybe you could include encryption when files are uploaded, our own PC would encrypt them and we would have complete access on what is encrypted and what is not. Thanks for your hard work on this marvellous tool.

gabriellluz avatar Dec 31 '13 10:12 gabriellluz

@karlitschek @MTRichards your take on this client-side file encryption discussion please.

jancborchardt avatar Jan 01 '14 14:01 jancborchardt

@csware I agree that it could be a useful feature in the future.Of course it comes with problems as @jancborchardt has poined out. The ownCloud company only has only a limited number of developers but a lof of open feature requests and bugs to solve. So unfortunately this feature is not in the focus for the near future. But ownCloud is an open community project so please feel free to contribute this feature. Thanks a lot for your understanding.

karlitschek avatar Jan 01 '14 15:01 karlitschek

Why should I try to implement it if you said "WontFix", this also implies: We're not going to include such a feature.

csware avatar Jan 01 '14 19:01 csware

I didn't say wontfix. I said we need more contributors and everyone can help. Of course we would include it if you submit a working pull request.

karlitschek avatar Jan 01 '14 19:01 karlitschek

Why did you close this feature request then instead of setting it to low priority (to show people that there is a real interest in this issue)?

csware avatar Jan 01 '14 20:01 csware