Crypt4GH File System
crypt4ghfs is a read-only fuse layer exposing Crypt4GH-encrypted files, as if they were decrypted
crypt4ghfs [-f|--foreground] [--conf conf_file] <mountpoint>
The default configuration file is in ~/.c4gh/fs.conf.
See the configuration sample for examples.
seckeymust point to a Crypt4GH private key or an ED25519 ssh key. This option is required.rootdirmust point to the root directory where the Crypt4GH-encrypted files reside. This option is required.- when not in read-only mode, a list of recipients must be specified (potentially only including yourself), for the case of an encrypting file system.
By default, we daemonize the process. Use -f (or --foreground) to keep it in the foreground. This is useful to see the logs, since stdout/stderr are otherwise redirected to /dev/null when the process is daemonized.
Extra debug output is available if log_level=LEVEL is used (where LEVEL is a Python logging levels)
Example
Assume you have Crypt4GH-encrypted files in ~/encrypted-files, and your private key in ~/.c4gh/mykey.
You can create a configuration file in ~/.c4gh/fs.conf with
[DEFAULT]
rootdir=~/encrypted-files
[CRYPT4GH]
seckey = ~/.c4gh/mykey
Create an (empty) directory, ~/clear-files and mount the Crypt4GH file system in it with:
crypt4ghfs ~/clear-files
You can now read files in ~/encrypted-files as if they were decrypted.
Instead of
crypt4gh decrypt --sk ~/.c4gh/mykey < ~/encrypted-files/example.txt.c4gh | less
you can now simply, use
cat ~/clear-files/example.txt
# or any other tool using the POSIX file abstraction
Tips: if you mount sshfs from the EGA distribution system, you can download chunk-by-chunk the files from the EGA, as Crypt4GH files, and use all of them with 2 commands:
sshfs -o uid=$(id -u),gid=$(id -g) -f <remote-url>:. ~/encrypted-files, followed bycrypt4ghfs ~/clear-files. After that, you keep your prompt and can "use" the files inls -al ~/clear-files.
Installation
The code is written in Python
(3.6+). libfuse and
pyfuse3 are required. To install
libfuse, you'll need cmake, meson and ninja.
On Ubuntu, run:
apt-get install ca-certificates pkg-config git gcc make automake autoconf libtool bzip2 zlib1g-dev libssl-dev libedit-dev ninja-build cmake udev libc6-dev
pip install -U pip
pip install meson pytest
Install the (latest) libfuse (v3.10) with:
git clone https://github.com/libfuse/libfuse.git
cd libfuse
git checkout fuse-3.10.0
mkdir build
cd build
meson ..
ninja
ninja install
Finally, install the python packages:
pip install crypt4ghfs
# this will install crypt4gh, trio and pyfuse3 too
For the (latest) SSHFS (v3.7), useful to test the above tips:
git clone https://github.com/libfuse/sshfs.git
cd sshfs
git checkout sshfs-3.7.0
mkdir build
cd build
meson ..
ninja
ninja install
Release files for crypt4ghfs 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crypt4ghfs-1.2.tar.gz | 12.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crypt4ghfs-1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.2 kB
Release files / crypt4ghfs-1.2.tar.gz
| Download URL | crypt4ghfs-1.2.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c67b6de7d235de52321e70136d6fa04e5088035ca94762be868913182d582b7
|
|
BLAKE2b-256 checksum How to use checksums |
10fe1f065863fd68a7ffcc54d82746fde0dbebc83e158fa92859637186222284
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / crypt4ghfs-1.2-py3-none-any.whl
| Download URL | crypt4ghfs-1.2-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e123ac12342681a49eb98da5d364b8433e2164cedfc2ef5678ccec566079679
|
|
BLAKE2b-256 checksum How to use checksums |
99608be77fba4032eecba84dfe21144416b7384f61c58493afce28861c25f51d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|