Skip to main content

E2EE for the inverse transparency toolchain

Project description

Py-It-Crypto

This python package implements E2EE encryption functionality for the inverse transparency toolchain [1]. It was developed in the scope of my master thesis at TUM. It is fully compatible with the corresponding Typescript library ts-it-crypto and Golang library go-it-crypto. The module was published to the python package index.

For a detailed description of the implemented protocol, security considerations and software architecture have a look to the thesis.

Installation

To use the go-it-crypto module you can install it with: pip install py-it-crypto

Usage

The functionality of this library requires a function that resolves the identity of users to a RemoteUser object. This objects holds the public keys of a user. This function is mandatory for decryption since it dynamically resolves the identities to the cryptographic keys of a user. This function needs to implement the following signature: RemoteUser fetchUser(string)

Assuming pub_A and priv_A are PEM-encoded public/private keys of a user, the following code initializes the it-crypto library for the owner of this keypair.

it_crypto = ItCrypto(fetch_sender)
it_crypto.login(owner.id, pub_A, pub_A, priv_A, priv_A)

The logged-in user can sign AccessLogs:

signedLog = it_crypto.sign_access_log(access_log)

The logged-in user can encrypt SignedAccessLogs for other users:

cipher = it_crypto.encrypt(singed_log, [receiver1, receiver2])

The logged-in user can decrypt tokens (this only succeeds if this user was specified as receiver during encryption):

received_signed_log = it_crypto.decrypt(cipher)
received_access_log = received_signed_log.extract()

Development

Running static analysis

Make sure you are in the root directory of this repo. Then simply run mypy .

Running tests

Make sure you are in the root directory of this repo. Then simply run pytest .

Build and Upload package

Build

python3 -m build

Upload Package to test.pypi

python3 -m twine upload --repository pypi dist/py_it_crypto-0.0.1*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_it_crypto-1.0.4.tar.gz (7.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_it_crypto-1.0.4-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file py_it_crypto-1.0.4.tar.gz.

File metadata

  • Download URL: py_it_crypto-1.0.4.tar.gz
  • Upload date:
  • Size: 7.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for py_it_crypto-1.0.4.tar.gz
Algorithm Hash digest
SHA256 bf4c1436926f09e1ce33b4b2ec6a822207992ade9bbde92a8a609fa322b6090a
MD5 b8bd95d3e5b0a8f0f38eedb76c2ddfd6
BLAKE2b-256 4fa20826c7665382adba5a2bd4dc08c249e4fe15a0e19c8f31a6df35c3078177

See more details on using hashes here.

File details

Details for the file py_it_crypto-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: py_it_crypto-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for py_it_crypto-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ab0b9f5ec35ef9b78bd03503936775cbad884b1d6d6048362339fb8f86cbeb02
MD5 87707f2015dfb5c69c9f070c3164504b
BLAKE2b-256 74779af2111262c53c9cb32f7a8df67a16d7640797fab2f1404a8536654e71a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page