https://github.com/colinxu2020/slhdsa
The pure python implement of the slh-dsa algorithm.
https://github.com/colinxu2020/slhdsa
crypto cryptography fips205 postquantum postquantumcryptography pqc pqcrypto python python-crypto python-cryptography python3 slh slh-dsa sphincs sphincs-plus sphincs-shake
Last synced: 2 months ago
JSON representation
The pure python implement of the slh-dsa algorithm.
- Host: GitHub
- URL: https://github.com/colinxu2020/slhdsa
- Owner: colinxu2020
- License: lgpl-3.0
- Created: 2024-07-08T07:40:19.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-11-26T02:30:45.000Z (4 months ago)
- Last Synced: 2025-11-29T05:30:47.469Z (4 months ago)
- Topics: crypto, cryptography, fips205, postquantum, postquantumcryptography, pqc, pqcrypto, python, python-crypto, python-cryptography, python3, slh, slh-dsa, sphincs, sphincs-plus, sphincs-shake
- Language: Python
- Homepage: https://pypi.org/project/slh-dsa
- Size: 364 KB
- Stars: 12
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: COPYING
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# SLH-DSA
[](https://github.com/colinxu2020/slhdsa/actions/workflows/ci.yml)
[](https://codecov.io/github/colinxu2020/slhdsa)


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. ✅ Complete 100% test coverage!
4. 🔖 Support any newer python version!
5. ⚒️ Design for Human!
6. 🎉 More futures coming soon!
The functionality is extremely simple to use, as demonstrated by the following example:
```python
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, shake_256f) # recovery public key
pub.verify(b"Hello World!", sig) # -> True
pub.verify(b"Hello World", sig) # -> False
```
## Copyright
Copyright(c) Colinxu2020 2024-2025 All Rights Reserved.
This software is licensed under GNU Lesser General Public License Version 3 or later(on your option).