Home

Awesome

zipsign

A tool to sign and verify .zip and .tar.gz files with an ed25519 signing key.

GitHub Workflow Status Crates.io License: License: Apache-2.0

Install

cargo install zipsign

or

cargo install --git https://github.com/Kijewski/zipsign

Example

Generate key

Usage: zipsign gen-key <PRIVATE_KEY> <VERIFYING_KEY>

Arguments:

Options:

Sign a .zip or .tar.gz file

Usage: zipsign sign [zip|tar] [-o <OUTPUT>] <INPUT> <KEYS>...

Subcommands:

Options:

Arguments:

Verify a signature

Usage: zipsign verify [zip|tar] <INPUT>

Subcommands:

Options:

Arguments:

Remove signatures

Usage: zipsign unsign [zip|tar] [-o <OUTPUT>] <INPUT>

Subcommands:

Arguments:

Options:

How does it work?

The files are signed with one or more private keys using ed25519ph. The signatures are stored transparently next to the data.

For .tar.gz files the signatures are encoded as base64 string. The string gets encapsulated as the comment of a GZIP file, and this GZIP file is appended to the input document. This works, because multiple GZIP files can be freely concatenated.

For .zip files the signature gets prepended to the input document. This works because ZIP files can be prepended with any data as long as all relative addresses are fixed up afterwards. This feature is used e.g. in self-extracting ZIP files.