Skip to main content

Python minisign library

Project description

Missing python minisign library.

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.12.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

py_minisign-0.12.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for py_minisign-0.12.0.tar.gz
Algorithm Hash digest
SHA256 1fa3f30c0b6c3f755d1ca22fe3b1bfbe5e4139ce8ed35fe67dffd2ced4ba259f
MD5 5990ca36682170efbd1a9bd67aa0577b
BLAKE2b-256 5d7af68f9967e246e197e310be7b7aa42c5aad0fea366434e9d5dda7b892e5b7

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on x13a/py-minisign

Attestations:

File details

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

File metadata

  • Download URL: py_minisign-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for py_minisign-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a67909ddf47d05cff28ca32f06ab1cfedbf92ee217e88cdae7d42528ccd82ad8
MD5 a25efb58f02a9bef4b0997fc7018eb94
BLAKE2b-256 8e75a59e0811f6ab171d8d6cae02b715753f78609314ac698ee1e624fe4c9059

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on x13a/py-minisign

Attestations:

Supported by

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