A file encryptor written in pure x86-64 Assembly for Linux.
krypt is a minimalist, modular tool that performs in-place XOR encryption/decryption. It bypasses libc and communicates directly with the Linux kernel via syscalls.
The project is split into three distinct modules to maintain separation of concerns:
- src/data.asm: The transformation engine. Implements a stateful, circular XOR cipher.
- src/io.asm: The interface layer. Handles raw Linux syscalls (
sys_open,sys_read,sys_write,sys_lseek). - src/main.asm: The orchestrator. Manages the execution flow and state persistence across data chunks.
- Zero Dependencies: Does not link against
libc. - In-Place Transformation: Uses
sys_lseekto overwrite bytes directly on the disk, minimizing memory footprint and I/O overhead. - Stateful Chunking: Processes files in 1KB chunks while maintaining the encryption key's offset, allowing it to handle files of any size.
- Modular Design: Uses the System V AMD64 ABI for internal function calls, making it easy to swap the encryption logic.
- NASM (Netwide Assembler)
- GNU Linker (ld)
- GNU Make
- Clone the repo:
git clone [https://github.com/your-username/krypt.git](https://github.com/your-username/krypt.git) cd krypt
make ./bin/krypt