Skip to content

Zedeldi/python-tang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-tang

GitHub license GitHub last commit Code style: black

Python implementation of the Tang protocol.

Description

Tang is a server for binding data to network presence.

python-tang implements the McCallum-Relyea key exchange, so that the Tang server must be accessible to reconstitute the binding key.

Basic peers are implemented in tang.peers, providing a class for the role of both client and server within the key exchange.

All cryptographic operations are implemented in tang.keys.KeyHelper, using ECC.EccKey from PyCryptodome. KeyHelper also provides methods to convert to/from a JWK using python-jose and an implementation of concatkdf from José.

The Tang protocol is implemented by tang.services.Tang. Methods for key advertisement and recovery are implemented by this class, to be used within the FastAPI app. Keys are loaded from the specified path at instantiation as JWKs. Filenames with a leading dot (.) are treated as rotated keys and will not be advertised.

Clevis

python-tang is compatible with Clevis:

$ clevis encrypt tang '{"url": "http://<tang server>"}' -y <<< "Hello, world" > ciphertext
$ clevis decrypt < ciphertext
Hello, world

Usage

Start server: fastapi run tang / uvicorn tang:app

Run demonstration of key exchange: python -m tang

Run tests: python -m pytest

Libraries

Credits

  • Tang - Tang binding daemon
  • Clevis - Automated encryption framework
  • José - C implementation of JOSE standards.

License

python-tang is licensed under the GPL v3 for everyone to use, modify and share freely.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

GPL v3 Logo

Donate

If you found this project useful, please consider donating. Any amount is greatly appreciated! Thank you 😃

PayPal

About

Python implementation of the Tang protocol.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages