Diffie-Hellman key exchange
% start synopsis % start main
This is a Python-only version of the Diffie-Hellman key exchange library.
% end synopsis
Features
- Implements Diffie-Hellman key exchange
- Pretty fast
- Adjustable key size
- Includes primes for groups 5 and 14-18
- Currently works only with Python 3 (requires ssl). An OpenSSL compatible version is in the works.
% end main
Usage
from moat.lib.diffiehellman import DiffieHellman
alice = DiffieHellman()
bob = DiffieHellman()
alice.generate_public_key() # automatically generates private key
bob.generate_public_key()
alice.generate_shared_secret(bob.public_key, echo_return_key=True)
bob.generate_shared_secret(alice.public_key, echo_return_key=True)
Code of Misconduct
By using this package, you pledge to use it for good, not for evil. In particular, you pledge never to use this code to limit the human mind or its natural rights, in particular freedom of expression.
Metadata
Release files for moat-lib-diffiehellman 0.13.8
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 |
|---|---|---|---|---|
| moat_lib_diffiehellman-0.13.8.tar.gz | 8.9 kB | Without provenance | Details for moat_lib_diffiehellman-0.13.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moat_lib_diffiehellman-0.13.8-py3-none-any.whl | Python 3 | none | any | Details for moat_lib_diffiehellman-0.13.8-py3-none-any.whl |
Total release size: 17.9 kB
Release files / moat_lib_diffiehellman-0.13.8.tar.gz
| Download URL | moat_lib_diffiehellman-0.13.8.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8305390c21c038b12bb78d042a10b414e7c97f8f18e09039cec7ac93c0d1f909
|
|
BLAKE2b-256 checksum How to use checksums |
0c3db19d02633027811499c282c2dcf6136f4587fe8328c7da2a560edbdbff67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / moat_lib_diffiehellman-0.13.8-py3-none-any.whl
| Download URL | moat_lib_diffiehellman-0.13.8-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a71a1ac612dabed3111b56d488834c81530a9b60826015f0d8c82bc24c0b562
|
|
BLAKE2b-256 checksum How to use checksums |
92c6fed5941515fb69bc288e20f47dd64f12cbac2c2f7f4fbd317349d222d1a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for moat-lib-diffiehellman 0.13.8
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.