Convert Figma logo to code with AI

jedisct1 logominisign

A dead simple tool to sign files and verify digital signatures.

2,348
128
2,348
0

Top Related Projects

18,759

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.

A high-level OpenPGP library

a modern crypto messaging format

A curated list of cryptography resources and links.

13,531

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

Quick Overview

Minisign is a dead simple tool to sign files and verify signatures. It is a more modern and simplified alternative to PGP, focusing solely on signing and verification. Minisign uses Ed25519 public-key signatures for enhanced security and performance.

Pros

  • Simple and easy to use, with a minimalist approach
  • Highly secure, utilizing Ed25519 public-key signatures
  • Cross-platform compatibility (Windows, macOS, Linux)
  • Lightweight and fast compared to more complex alternatives like PGP

Cons

  • Limited functionality compared to full-featured cryptographic suites
  • Lacks advanced features like key management and revocation
  • Not as widely adopted as PGP, which may limit interoperability in some scenarios

Code Examples

  1. Generating a new key pair:
minisign -G

This command generates a new public/private key pair for signing files.

  1. Signing a file:
minisign -Sm myfile.txt

This signs the file myfile.txt and creates a signature file myfile.txt.minisig.

  1. Verifying a signature:
minisign -Vm myfile.txt -P RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3

This verifies the signature of myfile.txt using the provided public key.

Getting Started

  1. Install Minisign:

    • On macOS: brew install minisign
    • On Linux: Use your package manager or build from source
    • On Windows: Download from the GitHub releases page
  2. Generate a key pair:

    minisign -G
    
  3. Sign a file:

    minisign -Sm myfile.txt
    
  4. Verify a signature:

    minisign -Vm myfile.txt -P <public_key>
    

Replace <public_key> with the actual public key generated in step 2.

Competitor Comparisons

18,759

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.

Pros of age

  • Supports multiple recipients and file encryption
  • Offers both symmetric and asymmetric encryption
  • More modern cryptographic primitives (ChaCha20-Poly1305, X25519)

Cons of age

  • Larger codebase and more complex implementation
  • Less widespread adoption compared to minisign
  • Requires more setup for key management

Code Comparison

minisign:

crypto_sign_keypair(pk, sk);
crypto_sign_detached(sig, &siglen, m, mlen, sk);
ret = crypto_sign_verify_detached(sig, m, mlen, pk);

age:

recipient, _ := age.ParseX25519Recipient(pubKey)
encrypted, _ := age.Encrypt(output, recipient)
decrypted, _ := age.Decrypt(input, identities...)

Summary

age offers more features and modern cryptography, making it suitable for complex encryption scenarios. minisign, on the other hand, focuses on simplicity and ease of use for file signing. age's flexibility comes at the cost of increased complexity, while minisign's straightforward approach may limit its use cases but ensures widespread compatibility and easier adoption.

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.

Pros of libsignal

  • Comprehensive end-to-end encryption library for secure messaging
  • Supports advanced features like forward secrecy and deniable authentication
  • Actively maintained and used in popular messaging applications

Cons of libsignal

  • More complex implementation due to its extensive feature set
  • Larger codebase and potentially higher resource usage
  • Steeper learning curve for developers

Code Comparison

minisign (simple signature verification):

unsigned char pk[crypto_sign_PUBLICKEYBYTES];
unsigned char sig[crypto_sign_BYTES];
if (crypto_sign_verify_detached(sig, message, message_len, pk) != 0) {
    /* Signature verification failed */
}

libsignal (establishing a secure session):

SessionBuilder sessionBuilder = new SessionBuilder(store, recipientId);
SessionCipher sessionCipher = new SessionCipher(store, recipientId);
CiphertextMessage message = sessionCipher.encrypt("Hello, world!".getBytes());

Summary

minisign focuses on simple and efficient file signing, while libsignal provides a comprehensive solution for secure messaging. minisign is easier to use for basic signing needs, while libsignal offers more advanced features at the cost of increased complexity.

A high-level OpenPGP library

Pros of gopenpgp

  • More comprehensive cryptographic functionality, including key management and encryption
  • Supports OpenPGP standard, allowing interoperability with other PGP implementations
  • Actively maintained by ProtonMail, a well-known privacy-focused company

Cons of gopenpgp

  • More complex to use due to its broader feature set
  • Larger codebase and dependencies, potentially increasing attack surface
  • May be overkill for simple signing and verification tasks

Code Comparison

minisign (simple signature verification):

func Verify(publicKey, signature, message []byte) error {
    return minisign.Verify(publicKey, signature, message)
}

gopenpgp (signature verification with more options):

func VerifyDetached(message, signature []byte, verifierKey *crypto.Key, verificationTime int64) (bool, error) {
    return crypto.NewPGPMessage(signature).VerifyDetached(crypto.NewPlainMessage(message), verifierKey, verificationTime)
}

Summary

minisign focuses on simplicity and ease of use for basic signing and verification tasks, while gopenpgp offers a more comprehensive suite of cryptographic functions adhering to the OpenPGP standard. The choice between the two depends on the specific requirements of the project, with minisign being more suitable for straightforward signing needs and gopenpgp for more complex cryptographic operations.

a modern crypto messaging format

Pros of Saltpack

  • More comprehensive cryptographic protocol, supporting encryption and signing
  • Designed for modern use cases, including streaming and multi-recipient encryption
  • Robust key management system integrated with Keybase platform

Cons of Saltpack

  • More complex implementation and usage compared to Minisign
  • Requires Keybase ecosystem for full functionality
  • Larger codebase and dependencies

Code Comparison

Minisign (signing a file):

minisign -Sm myfile.txt

Saltpack (signing a file):

keybase pgp sign -i myfile.txt -o myfile.txt.signed

Key Differences

  • Minisign focuses solely on digital signatures, while Saltpack offers a broader range of cryptographic operations
  • Minisign is a standalone tool, whereas Saltpack is tightly integrated with the Keybase platform
  • Saltpack provides more advanced features like multi-recipient encryption and streaming support

Use Cases

  • Minisign: Simple file signing and verification, software distribution
  • Saltpack: Secure messaging, file encryption, and signing within the Keybase ecosystem

Community and Development

  • Minisign: Smaller, focused community; actively maintained
  • Saltpack: Larger ecosystem due to Keybase integration; development status uncertain following Keybase acquisition

A curated list of cryptography resources and links.

Pros of awesome-cryptography

  • Comprehensive resource for cryptography-related tools, libraries, and information
  • Regularly updated with community contributions
  • Covers a wide range of cryptographic topics and applications

Cons of awesome-cryptography

  • Not a standalone tool or library for cryptographic operations
  • May require additional research to determine the best tools for specific use cases
  • Can be overwhelming for beginners due to the vast amount of information

Code comparison

Not applicable, as awesome-cryptography is a curated list of resources rather than a code repository. Minisign, on the other hand, is a practical tool for creating and verifying cryptographic signatures. Here's a basic example of using Minisign:

# Generate a key pair
minisign -G

# Sign a file
minisign -Sm myfile.txt

# Verify a signature
minisign -Vm myfile.txt -P RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3

Summary

Minisign is a focused tool for cryptographic signatures, while awesome-cryptography is a comprehensive resource for various cryptographic topics. Minisign provides practical functionality, whereas awesome-cryptography offers a wealth of information and links to other tools and libraries. Choose Minisign for specific signature needs, and use awesome-cryptography for research and discovering a wide range of cryptographic resources.

13,531

Tink is a multi-language, cross-platform, open source library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

Pros of Tink

  • Comprehensive cryptographic library with support for various primitives
  • Cross-platform compatibility (Java, C++, Go, Python)
  • Actively maintained by Google with regular updates

Cons of Tink

  • Larger and more complex codebase
  • Steeper learning curve for beginners
  • May be overkill for simple signing tasks

Code Comparison

Minisign (signing a file)

#include "minisign.h"

int main(void) {
    minisign_sign_file("input.txt", "output.sig", secretkey, NULL);
    return 0;
}

Tink (signing data)

import com.google.crypto.tink.signature.SignatureConfig;

public class TinkExample {
    public static void main(String[] args) throws Exception {
        SignatureConfig.register();
        KeysetHandle keysetHandle = KeysetHandle.generateNew(SignatureKeyTemplates.ED25519);
        PublicKeySign signer = keysetHandle.getPrimitive(PublicKeySign.class);
        byte[] signature = signer.sign("data to sign".getBytes());
    }
}

Summary

Minisign is a lightweight, focused tool for file signing, while Tink is a comprehensive cryptographic library. Minisign offers simplicity and ease of use for specific signing tasks, whereas Tink provides a wide range of cryptographic primitives and cross-platform support. The choice between them depends on the project's requirements and complexity.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CodeQL scan

Minisign

Minisign is a dead simple tool to sign files and verify signatures.

For more information, please refer to the Minisign documentation

Tarballs and pre-compiled binaries can be verified with the following public key:

RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3

Compilation / installation

Building with Zig

Dependencies:

Compilation with libsodium, dynamically linked (libsodium will need to be installed on the system for the command to run):

$ zig build -Doptimize=ReleaseSmall

Compilation with libsodium, statically linked (libsodium will only be needed for compilation):

$ zig build -Doptimize=ReleaseSmall -Dstatic

Compilation without libsodium, no dependencies required:

$ zig build -Doptimize=ReleaseSmall -Dwithout-libsodium

The resulting binary can be found in zig-out/bin/minisign.

In all these examples, ReleaseFast can be replaced with ReleaseSmall to favor speed over size.

Building with cmake and gcc or clang:

Dependencies:

  • libsodium (required)
  • cmake
  • pkg-config
  • gcc or clang

Compilation:

$ mkdir build
$ cd build
$ cmake ..
$ make
# make install

Alternative configuration for static binaries:

$ cmake -D STATIC_LIBSODIUM=1 ..

or:

$ cmake -D BUILD_STATIC_EXECUTABLES=1 ..

Pre-built packages

Minisign is also available in Homebrew:

$ brew install minisign

Minisign is also available in Scoop on Windows:

$ scoop install minisign

Minisign is also available in chocolatey on Windows:

$ choco install minisign

Minisign is also available with docker:

$ docker run -i --rm jedisct1/minisign

For example, verifying a signature using the docker image can be done with:

$ docker run -v .:/minisign -e HOME=/minisign -w /minisign \
  -it --rm jedisct1/minisign \
  -Vm file_to_verify -p minisign.pub

The image can be verified with the following cosign public key:

-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExjZWrlc6c58W7ZzmQnx6mugty99C
OQTDtJeciX9LF9hEbs1J1fzZHRdRhV4OTqcq0jTW9PXnrSSZlk1fbkE/5w==
-----END PUBLIC KEY-----

Additional tools, libraries and implementations

  • minizign is a compact implementation in Zig, that can also use ssh-encoded keys.
  • minisign-misc is a very nice set of workflows and scripts for macOS to verify and sign files with minisign.
  • go-minisign is a small module in Go to verify Minisign signatures.
  • rust-minisign is a Minisign library written in pure Rust, that can be embedded in other applications.
  • rsign2 is a reimplementation of the command-line tool in Rust.
  • minisign (go) is a rewrite of Minisign in the Go language. It reimplements the CLI but can also be used as a library.
  • minisign-verify is a small Rust crate to verify Minisign signatures.
  • minisign-net is a .NET library to handle and create Minisign signatures.
  • minisign a Javascript implementation.
  • WebAssembly implementations of rsign2 and minisign-cli are available on WAPM.
  • minisign-php is a PHP implementation.
  • py-minisign is a Python implementation.
  • minisign is an Elixir implementation (verification only)

Signature determinism

This implementation uses deterministic signatures, unless libsodium was compiled with the ED25519_NONDETERMINISTIC macro defined. This adds random noise to the computation of EdDSA nonces.

Other implementations can choose to use non-deterministic signatures by default. They will remain fully interoperable with implementations using deterministic signatures.