Skip to main content

Efficient, secure data serialization format with extensibility.

Project description

Kasten 🖃

Binary serialization format with metadata, validation, and configurable hash IDs with proof-of-work (VDF) support.

Kasten is intended to wrap messages for transport agnostic communication.

Sending a message:

import kasten

# Bob creates message

message = b"hello world"
# Mode for any external lib to use
encrypt_mode = 0
packed_message: bytes = kasten.generator.pack.pack(message, 'txt', encrypt_mode)

# We pick the base generator which checks for sha3_256 validity and that's it
# However we could also pick KastenMimcGenerator which has both validity and proof-of-work ratelimiting
# Or, we could make our own. Both parties just need the same logic.
kasten = kasten.generator.KastenBaseGenerator.generate(packed_message)

message_checksum: bytes = kasten.id

# Bob sends packed_message and message_checksum to Alice

Receiving a message:

import kasten

# Alice receives message
bobs_message = b'\x93\xa3txt\x00\xce_F\xc7!\nhello world'
bobs_checksum = b"\xac\x83K=n\xdb\xba\x9aJ\xca:\x82]'9b\xd0\x98\xda\xee'\x9f\xf2\xd7\x94\x9e\x91\x94\x9dnh6\x02\x03\xf0\xfe\x85\xbdrLj]R\xeb;xB@"

# Recreate on Alice's end using the checksum, message, and the same generator
# The generator will automatically check message validity and throw a kasten.exceptions.InvalidID exception if failed
kasten_message = kasten.Kasten(bobs_checksum, bobs_message, kasten.generator.KastenBaseGenerator)

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

kasten-3.0.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

kasten-3.0.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file kasten-3.0.0.tar.gz.

File metadata

  • Download URL: kasten-3.0.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for kasten-3.0.0.tar.gz
Algorithm Hash digest
SHA256 52894af46d6e1339f0d5fa8961892b292f99176848bce11877fe4a435b6782e5
MD5 ca5e17750b8d91e722301de37de33b30
BLAKE2b-256 9de332a2f1ac719384bb18df5632aa658c632605b0624d48a1f9797afce037aa

See more details on using hashes here.

File details

Details for the file kasten-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: kasten-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for kasten-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b22ebdc5f475c2ef9ab74abc36552add0b37732a7ce2be6bd7977ee41b2163b4
MD5 abddd40c178fd63d13c32ecf63baea7e
BLAKE2b-256 de5654fb5cbb834e555fc20c0aed1498d0cffdff95d73a04d5020a6b358cfbc3

See more details on using hashes here.

Supported by

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