Get the image
docker pull xorio42/rencfsStart a container to set up mount in it
docker run -v ~/Downloads:/share -it --device /dev/fuse --cap-add SYS_ADMIN --security-opt apparmor:unconfined xorio42/rencfs:latest /bin/shReplace ~/Downloads with a path you want to share with the container.
In the container, create mount and data directories
mkdir mnt && mkdir dataStart rencfs
rencfs mount --mount-point mnt --data-dir data -l WARNEnter a password for encryption.
Get the container ID
docker psIn another terminal, attach to the running container with the above ID
docker exec -it <CONTAINER-ID> /bin/shFrom here, you can play with it by creating files in mnt directory
cd mnt
mkdir 1
ls
echo "test" > 1/test
cat 1/testYou can also copy files from /share.
cd mnt
cp /share/file1.txt .
file file1.txtFor the library, you can follow the documentation.
To use the encrypted file system, you need to have FUSE installed on your system. You can install it by running the following command (or based on your distribution).
Arch
sudo pacman -Syu && sudo pacman -S fuse3Ubuntu
sudo apt-get update && sudo apt-get -y install fuse3You can install the encrypted file system binary using the following command
yay -Syu && yay -S rencfsYou can install the encrypted file system binary using the following command
cargo install rencfsA basic example of how to use the encrypted file system is shown below
rencfs mount --mount-point MOUNT_POINT --data-dir DATA_DIR
MOUNT_POINTact as a client, and mount FUSE at the given pathDATA_DIRwhere to store the encrypted data with the sync provider. But it needs to be on the same filesystem as the data-dir
It will prompt you to enter a password to encrypt/decrypt the data.
The master encryption key is stored in a file and encrypted with a key derived from the password. This offers the possibility to change the password without needing to re-encrypt the whole data. This is done by decrypting the master key with the old password and re-encrypting it with the new password.
To change the password, you can run the following command
rencfs passwd --data-dir DATA_DIR DATA_DIR where the encrypted data is stored
It will prompt you to enter the old password and then the new password.
You can specify the encryption algorithm by adding this argument to the command line
--cipher CIPHER ...Where CIPHER is the encryption algorithm. You can check the available ciphers with rencfs --help.
The default value is ChaCha20Poly1305.
You can specify the log level by adding the --log-level argument to the command line. Possible
values: TRACE, DEBUG, INFO (default), WARN, ERROR.
rencfs --log-level LEVEL ...You can see more here