Skip to main content

Python minisign library

Project description

Missing python minisign library.

Install

pip install py-minisign

Library

import os
import minisign

# verify

pk = minisign.PublicKey.from_base64(
    'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3')
sig = minisign.Signature.from_bytes(
    b'untrusted comment: signature from minisign secret key\n'
    b'RWQf6LRCGA9i59SLOFxz6NxvASXDJeRtuZykwQepbDEGt87ig1BNpWaVWuNrm73YiIiJbq71Wi+dP9eKL8OC351vwIasSSbXxwA=\n'
    b'trusted comment: timestamp:1555779966\tfile:test\n'
    b'QtKMXWyYcwdpZAlPF7tE2ENJkRd1ujvKjlj1m9RtHTBnZPa5WKU5uWRs5GoP5M/VqE81QFuMKI5k/SfNQUaOAA=='
)
pk.verify(b'test', sig)

# sign

sk = minisign.SecretKey.from_file('/path/to/secret.key')
sk.decrypt('strong_password')
sig = sk.sign(b'very important data')

# generate key pair

key_pair = minisign.KeyPair.generate()
sk = key_pair.secret_key
pk = key_pair.public_key

# save key

sk.encrypt('strong_password')
with open(os.open('/path/to/secret.key', os.O_CREAT | os.O_WRONLY, 0o600), 'wb') as f:
    f.write(bytes(sk))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_minisign-0.13.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_minisign-0.13.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file py_minisign-0.13.2.tar.gz.

File metadata

  • Download URL: py_minisign-0.13.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_minisign-0.13.2.tar.gz
Algorithm Hash digest
SHA256 52b7e486649385496d5d103c5c7584ac74f6e002557ef3ad2e0152119d4a2cce
MD5 b887c3c6358de23764b9b392cf9347dd
BLAKE2b-256 006898a555cde13b1532519b06b0e1691621396e472acbf288b3b7ace1aa4cab

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_minisign-0.13.2.tar.gz:

Publisher: publish.yml on x13a/py-minisign

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_minisign-0.13.2-py3-none-any.whl.

File metadata

  • Download URL: py_minisign-0.13.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_minisign-0.13.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bdb8d9ac6d9673f7f3ed528aa6a5a03c7a982b64278139da18b79a6f1500550e
MD5 499f8b30406e5309d69c90a00c2e22c0
BLAKE2b-256 2b3713db27c67625caa205bc5efe60cca6fb2753ed21f7f090d6975f0dd0ce9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_minisign-0.13.2-py3-none-any.whl:

Publisher: publish.yml on x13a/py-minisign

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page