Zero-knowledge file possession and comparison utility.
zkcmp is a minimal Unix utility exploring whether knowledge of a file-derived secret can be demonstrated without revealing the file itself.
Experimental / exploratory software.
The protocol and implementation are still evolving. Do not rely on
zkcmpfor security-critical applications, authentication, or protection of valuable secrets.
zkcmp derives a secret (hash) from a file:
file
↓
hash
↓
commitment
↓
zero-knowledge proof
The proof is constructed so that the secret itself does not need to be transmitted.
The current implementation uses a Schnorr-style proof of knowledge over a 3072-bit MODP group.
The default hash is SHA-256. SHA3-256 or SHA512-256 can also be selected.
Read more about Schnorr proof.
zkcmp provides three operations:
zkcmp [-h sha256|sha3-256|sha512-256] -c file
zkcmp [-h sha256|sha3-256|sha512-256] -p file
zkcmp [-s] [-h sha256|sha3-256|sha512-256] commit proof
Creates a reusable public commitment from a file.
zkcmp -c release.tar > release.tar.commitA commitment can be published once and used as the public statement for multiple independent proofs.
Creates a proof from a local file.
zkcmp -p release.tar > release.tar.proofVerifies a proof against a previously created commitment.
zkcmp release.tar.commit release.tar.proofThis is useful when a commitment has been published and multiple parties need to demonstrate knowledge of the corresponding secret.
For example:
server$ zkcmp -c release.tar > release.tar.commit
alice$ zkcmp -p release.tar > alice.proof
bob$ zkcmp -p release.tar > bob.proof
server$ zkcmp release.tar.commit alice.proof
server$ zkcmp release.tar.commit bob.proofOn FreeBSD & OpenBSD:
make
make installSee LICENSE for licensing information.
Nami Arjmandi