A simple Python library for generating Rabin signatures
Usage
As a Python module
import rabin
# Generate prime pair
seed = b'\x01'
p, q = rabin.gen_prime_pair(seed)
n = p * q
# Sign message
message = bytes.fromhex('00112233445566778899aabbccddeeff')
sig, pad = rabin.sign_rabin(p, q, message)
# Verify signature
res = rabin.verify_rabin(n, message, sig, pad)
From the command line
- Generate key pairs with a seed.
> rabin G 01
generate primes ...
n_rabin = 0x4dd67a38e65c6d5d0877e892f1453fa09d27313f1431fcea6e703571fd56bf0b8bdd4788d94a7ec79c4232ead62eb34cd4f212e13fddaadf659ac6e45dc32c9
- Sign a message: get number of padding bytes and signature
> rabin S 00112233445566778899aabbccddeeff
padding = 3
digital signature = 0x420818748a86065611c0e1be3c0bae9c22fe5e515a4a35601be8b4d8bc1049c75775e01e07e2257a689e916ea7751bdfc8b1eeb51d418e2714ae2fc8eadde1b
- Verify signature with results from step 2
> rabin V 00112233445566778899aabbccddeeff 3 420818748a86065611c0e1be3c0bae9c22fe5e515a4a35601be8b4d8bc1049c75775e01e07e2257a689e916ea7751bdfc8b1eeb51d418e2714ae2fc8eadde1b
result of verification: True
Metadata
Release files for rabin 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rabin-0.1.0.tar.gz | 3.6 kB | Without provenance | Details for rabin-0.1.0.tar.gz |
Release files / rabin-0.1.0.tar.gz
| Download URL | rabin-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35e184484ea253fc943090c43ae5fae4acaa93bd562d36b29bbb5d4219194169
|
|
BLAKE2b-256 checksum How to use checksums |
cbef88e6177f0e61631a6b8a9618d93e9b4bcf8c85c68bb6c52731c3aa9d59ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
|
Security for rabin 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.