Metadata-Version: 2.4
Name: lib25519
Version: 20241004.2
Summary: Python wrapper around implementation of the X25519 and Ed25519 cryptosystems
Author-email: Jan Mojžíš <jan.mojzis@gmail.com>
License: SPDX-License-Identifier: CC0-1.0 OR 0BSD OR MIT-0 OR MIT
        
        - [CC0-1.0](https://spdx.org/licenses/CC0-1.0.html)
        - [0BSD](https://spdx.org/licenses/0BSD.html)
        - [MIT-0](https://spdx.org/licenses/MIT-0.html)
        - [MIT](https://spdx.org/licenses/MIT.html)
        
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

Python wrapper around [lib25519](https://lib25519.cr.yp.to) library,
wrapper around X25519 and Ed25519 cryptosystems.

### X25519

Import library:

    from lib25519 import x25519

Key generation:

    alicepk, alicesk = x25519.keypair()
    bobpk, bobsk = x25519.keypair()

Shared-secret generation:

    bobk = x25519.dh(alicepk, bobsk)
    alicek = x25519.dh(bobpk, alicesk)

Check:

    assert alicek == bobk

### Ed25519

Import library:

    from lib25519 import ed25519

Key generation:

    alicepk, alicesk = ed25519.keypair()

Signature generation:

    m = b'Hello'
    sm = ed25519.sign(m, alicesk)

Signature verification and message recovery:

    recoveredm = ed25519.open(sm, alicepk)

Check:

    assert m == recoveredm
