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

Uploaded Python 3

File details

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

File metadata

  • Download URL: py_minisign-0.13.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d6dd0a4c15bcfe151be999f8ef17fc0c2baa98d5420519169bf880cb924aa538
MD5 c23420f667a2848fbbc1bcbe22c8771b
BLAKE2b-256 96839cd69052b2b7bdaab524e90bfc1f8602324f01d9fa56f914b39a4d36c20c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: py_minisign-0.13.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d7c327f3c947cd5a1211e8f1c3cec823a25ab0e3517994227ca2c0e368e6759d
MD5 4688337caebe6bddcddb0b46171e139d
BLAKE2b-256 276abca75d5d06f56a847431f824e32115f14ece1636dc30468d5a2daf8848e8

See more details on using hashes here.

Provenance

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