From 3007e5aa9a4dfc3c0f63b928f853166a63e71882 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Wed, 26 Aug 2020 20:58:31 +0000 Subject: [PATCH] Added more docs to readme --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++- setup.py | 2 +- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a66189e..3c3b9b6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,44 @@ Kasten 🖃 -Binary serialization format with metadata, validation, and secure cryptographic checksum IDs with proof-of-work (VDF) support. +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) +``` + diff --git a/setup.py b/setup.py index ff9d2b4..144f2f4 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup(name='kasten', - version='0.0.6', + version='0.0.7', description='Efficient, secure data serialization format with extensibility.', author='Kevin Froman', author_email='beardog@mailbox.org',