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.0.tar.gz (7.4 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.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for py_minisign-0.13.0.tar.gz
Algorithm Hash digest
SHA256 789314443c7af9b2d39109582bc1ee8b8b67aad6f057ef79b026ebfc1549e360
MD5 854ba45f6c59c9e56658aea7e107a392
BLAKE2b-256 75b2d1ad7279f282b5580ab6def401f1069dc2200af00fd4cfb2cb7b50834797

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_minisign-0.13.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: py_minisign-0.13.0-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.7

File hashes

Hashes for py_minisign-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ebf7feb49b3a539d93c70e1cf7c5d62cbdaa1618c32b438f5871c9809ac3a32
MD5 87f5a42adb3c45df721d00e584ce5853
BLAKE2b-256 c3a7c3a6df92c20cbe0f905747390e0e69852f27872ef86e192444386360ffc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_minisign-0.13.0-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