Skip to content
namiarjPublic

About

Zero-knowledge file comparison utility

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

94 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zkcmp

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.

Status

Experimental / exploratory software.

The protocol and implementation are still evolving. Do not rely on zkcmp for security-critical applications, authentication, or protection of valuable secrets.

How it works

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.

Commands

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

-c

Creates a reusable public commitment from a file.

zkcmp -c release.tar > release.tar.commit

A commitment can be published once and used as the public statement for multiple independent proofs.

-p

Creates a proof from a local file.

zkcmp -p release.tar > release.tar.proof

Verification

Verifies a proof against a previously created commitment.

zkcmp release.tar.commit release.tar.proof

This 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.proof

Building

On FreeBSD & OpenBSD:

make
make install

License

See LICENSE for licensing information.

Author

Nami Arjmandi

About

Zero-knowledge file comparison utility

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages