How your files are protected
Every file is encrypted before it is written to disk, with its own key.
- Contents: AES-256-GCM with a fresh key and nonce per file. A changed byte fails the GCM tag check, so tampering is detected when the file is opened.
- Key wrap: ML-KEM-768 + X25519. Each file key is sealed with a post-quantum and a classical key exchange, so both would have to be broken.
- Master key: kept in the server's secrets folder (a Docker secret), outside the database, the logs and the code.
Downloads are decrypted on the server for the signed-in user only, and every download is recorded.
Who can see what
One gate on the server checks every request: your role decides which files you can open and search.
- Admin: every department, plus people, roles and the audit log.
- HR: the files of their own department, upload and type changes.
- Employee: only their own files, and who opened them.
Search results and counts never include files you can't open, and a refused request is recorded too.
Searching scanned documents
At upload, Kavach reads the text of PDFs and Word files, and runs Tesseract OCR on scans and phone photos. The text is indexed, then the file is encrypted.
Search shows highlighted snippets, only from files you are allowed to open. Every search is logged with its query.
Proving nothing was changed
The audit log is a hash chain: each entry stores the SHA3-256 hash of the one before it, and the database refuses edits and deletes.
- Verify chain re-checks every link. One edited row breaks the chain at that entry.
- Seal checkpoint signs the chain head with ML-DSA-65, so a later check can prove what the log looked like then.