Debian – How to encrypt data in a folder in a samba share, and share it both encrypted and decrypted

debianencryptionnassamba

So far I have a Debian NAS with a samba share accessible from a Windows client by user credentials. Within that share I have a folder of images encrypted by ecryptfs. A friend of mine have agreed to "host" a synced copy of my encrypted images on his NAS, but at the same time I want a synced copy/access of decrypted images on my Windows machine.

One idea is if some encryption tool on NAS is able to always maintain two folders of the same data; one encrypted, one decrypted? and then share them accordingly with btsync or similar.
disadvantage of this would be double the space used.

Better specified suggestion of above or other solutions to my problem are greatly appreciated!

Best Answer

If you were using a tool like eCryptfs that decrypts file "on-the-fly", you could mount and share the decrypted data in a "Visible" folder, and also separately share the encrypted data in the ".Private" folder.

The "Visible" folder's decrypted data is only visible while mounted, and it doesn't take up any extra disk space since it's not a hard on-disk decrypted copy (that would be extremely insecure). Unmounting it stops the decryption and leaves only the encrypted ".Private" folder.

See the eCryptfs documentation here http://ecryptfs.org/documentation.html

Especially these entries:

EncFS works similarly, isn't supposed to require root access, but isn't usually installed by default on most distro's I've seen (like Mint, Ubuntu...)

Related Question