Expand description
The core of this program. Encrypt/decrypt, compress/decompress files.
GITSE Binary Header Layout (64 Bytes) 00 04 05 06 07 17 2F 3F +———–+—+—+—+———–+—————––+—————+ | MAGIC | V | F | A | SALT | NONCE | RESERVED | | “GITSE” | | | | (16 bytes)| (24 bytes) | (16 bytes) | +———–+—+—+—+———–+—————––+—————+ 5 bytes 1 1 1 16 bytes 24 bytes 16 bytes | | | Version —+ | +— Encryption Algo (1 = XChaCha20-Poly1305 Stream) | Flags ––––+ (Bit 0: Compression)
Streaming Format:
Files are processed in 64KB chunks to prevent OOM on large files.
Each chunk is individually encrypted using XChaCha20-Poly1305.
The nonce for chunk i is derived by XORing the last 8 bytes of the base
nonce with i.
Structs§
Functions§
- decrypt_
file - Decrypt a single file using streaming chunked decryption.
- decrypt_
file_ with_ cache - Decrypt a single file using streaming chunked decryption, with a thread-safe cache for derived keys.
- decrypt_
repo - Decrypt given files in the repo. If no paths are given, decrypt all files in the repo’s crypt list.
- encrypt_
file - Encrypt a single file using streaming chunked encryption.
- encrypt_
repo - Encrypt given files in the repo. If no paths are given, encrypt all files in the repo’s crypt list.