Metadata-Version: 2.4
Name: moat-lib-diffiehellman
Version: 0.13.6
Summary: A Pythonic implementation of the Diffie-Hellman key exchange protocol
Author-email: Matthias Urlichs <matthias@urlichs.de>, Chris von Csefalvay <chris@chrisvoncsefalvay.com>
Maintainer-email: Matthias Urlichs <matthias@urlichs.de>
Project-URL: homepage, https://m-o-a-t.org
Project-URL: repository, https://github.com/M-o-a-T/moat
Keywords: MoaT
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AnyIO
Classifier: Framework :: Trio
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Developers
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: anyio~=4.2
Dynamic: license-file

# diffiehellman
![Travis CI](https://travis-ci.org/chrisvoncsefalvay/diffiehellman.svg?branch=master) [![PyPI version](https://badge.fury.io/py/diffiehellman.svg)](https://badge.fury.io/py/diffiehellman)

% start synopsis

This is a Python-only version of the Diffie-Hellman key exchange library.

% end synopsis

## Usage

```python
from diffiehellman.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)
```

## Install

```shell
pip install diffiehellman
```

## 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.

## 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.
