A C++ library and CLI tool ๐ง to seal a directoryโs state ๐ฆ ๐จ. In essence, gets the hash of a directory.
Currently barely stable, and far from how I'd imagined it.
While that technically doesnโt mean one specific thing (capable of being interpreted and/or implemented in different ways), here it means recursively hashing its contents using a tree structure. Including the metadata of each dir-tree node as well, this โstampโ hash that is thus calculated should make it very hard for a directory to be tampered with secretly.
Itโs been done before โ hash-trees (also โMerkle treesโ after their creator Ralph C. Merkle) of directories are used in the BitTorrent protocol ๐ฅ, macOS SSV, and git ๐โฅ itself.
But this project aims at making a near-standalone library (as well as an exemplifying frontend CLT) available, for any other great ideas yet unimplemented to gain a head-start.
documentation coming soon
(once the library gets big enough โ if it gets big enough)
Relies on the GnuPG projectโs crypto library (libgcrypt
) for all the hashing work.
- Ensure that
libgcrypt
(โฅv1.8.7
) is installed on your system. If youโre on linux, you can probably skip this step. For other platforms, the easiest way is often to get GnuPG itself. There are several binaries suggested by GnuPG here. - Ensure your compiler and linker have access to
libgcrypt
โs headers and object-libraries. You can find out what flags to pass to your compiler by runninglibgcrypt-config --cflags --libs
, once you have ensured thatlibgcrypt
is installed. - Build!
- macOS (requires Xcode CLT or a separate installation of
clang
orgcc
):clang++ -dylib -std=gnu++17 ./src/* -o libsealdir.dylib
- Linux:
g++ -flinker-output=dyn -std=gnu++17 ./src/* -o libsealdir.so
- macOS (requires Xcode CLT or a separate installation of
N.B.: libgcrypt
is distributed under the GNU GPL v3, which has different terms and distribution-restrictions from the BSD โ3-Clauseโ license used in the rest of this software.