Skip to main content

The pure python impl of the slh-das algorithm(based on fips205).

Project description

SLH-DSA

Test And Build codecov PyPI - Downloads GitHub License

The SLH-DSA project implements the stateless-hash digital signing algorithm(standardizing fips 205, adopted on Sphincs-Plus algorithm) in pure Python.

This project offers those future:

  1. 🍻 Zero dependencies;
  2. 🏷️ 100% type hint for all the codes;
  3. ✅ Extreme good 98% test coverage;
  4. 🔖 Support any newer python version!
  5. ⚒️ Design for Human!
  6. :tada: More futures coming soon!

The functionality is extremely simple to use, as demonstrated by the following example:

from slhdsa import KeyPair, shake_256f, PublicKey

kp = KeyPair.gen(shake_256f)  # generate the keypair
sig = kp.sign(b"Hello World!")  # sign the message
kp.verify(b"Hello World!", sig)  # -> True
kp.verify(b"Hello World!", b"I'm the hacker!") # -> False
kp.verify(b"hello world!", sig)  # -> False
sig = kp.sign(b"Hello World!", randomize = True)  # sign the message randomized
kp.verify(b"Hello World!", sig)  # -> True

digest = kp.pub.digest()  # generate the digest of the public key so that other device could verify the sign
pub = PublicKey.from_digest(digest)  # generate public key
pub.verify(b"Hello World!", sig)  # -> True
pub.verify(b"Hello World", sig)  # -> False

Copyright

Copyright(c) Colinxu2020 2024 All Rights Reserved.

This software is licensed under GNU Lesser General Public License Version 3 or later(on your option).

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

slh_dsa-0.1.3.tar.gz (255.8 kB view details)

Uploaded Source

Built Distribution

slh_dsa-0.1.3-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file slh_dsa-0.1.3.tar.gz.

File metadata

  • Download URL: slh_dsa-0.1.3.tar.gz
  • Upload date:
  • Size: 255.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.16.1 CPython/3.12.1 Windows/11

File hashes

Hashes for slh_dsa-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d0eb63948ff0dc5d0e5aef9fb1023d337948418d0dc78f186efa06710d002756
MD5 3646e2e226e9be3fcc0d3fa7be67c883
BLAKE2b-256 1019899a14b35e40147010d3b18e29f1b3e57142a53eb18d835f673370bcb915

See more details on using hashes here.

File details

Details for the file slh_dsa-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: slh_dsa-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.16.1 CPython/3.12.1 Windows/11

File hashes

Hashes for slh_dsa-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7b0d13a16a668fe57d7765ec8b7e3a1f19348d7043d1a9a40a8bd48c4cacc97d
MD5 bf661b2d7519337e2ba1047ca64ee2a7
BLAKE2b-256 6ab5d4f096ee227c2f6ebd2b3a6d9790d7604711b03c3817b8b0fe6c874c5ee5

See more details on using hashes here.

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