From 9ac547250ef9cee18bce4c84decd967cf64208b8 Mon Sep 17 00:00:00 2001 From: Dominik Klein <397515+asdfjkl@users.noreply.github.com> Date: Thu, 8 Sep 2022 14:55:31 +0200 Subject: [PATCH 1/4] Create README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0dce870 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Kyber512 in Python + +- for now, 512 only but should be easily extendable to 768 and 1024 sec levels. +- ported from the [Go Implementation](https://github.com/kudelskisecurity/crystals-go), so not the fanciest Python code +- not hardened against (timing/other) side channel attacks From 99009255d6ee19b98d173dfd506285305f0daee4 Mon Sep 17 00:00:00 2001 From: Dominik Klein <397515+asdfjkl@users.noreply.github.com> Date: Thu, 8 Sep 2022 14:58:50 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 0dce870..d310967 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # Kyber512 in Python +## About + +- just a toy implementation to better understand the algorithm - for now, 512 only but should be easily extendable to 768 and 1024 sec levels. - ported from the [Go Implementation](https://github.com/kudelskisecurity/crystals-go), so not the fanciest Python code - not hardened against (timing/other) side channel attacks + +## How To Use + +Just take a look at `cakem.py`. Functions `kem_keygen512()`, kem_encaps512(pubkey, seed=None)` and `kem_decaps512(private_key, ciphertext)` correspond directly to the [spec](https://pq-crystals.org/). For `kem_encaps` you can optionally provide a custom `m` which is useful for debugging. From 4c32272975dbd7e42c108f1e3b261cfaa6949283 Mon Sep 17 00:00:00 2001 From: Dominik Klein <397515+asdfjkl@users.noreply.github.com> Date: Thu, 8 Sep 2022 14:59:16 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d310967..ff3bcd2 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,10 @@ ## How To Use -Just take a look at `cakem.py`. Functions `kem_keygen512()`, kem_encaps512(pubkey, seed=None)` and `kem_decaps512(private_key, ciphertext)` correspond directly to the [spec](https://pq-crystals.org/). For `kem_encaps` you can optionally provide a custom `m` which is useful for debugging. +Just take a look at `cakem.py`. Functions + +- `kem_keygen512()`, +- `kem_encaps512(pubkey, seed=None)` and +- `kem_decaps512(private_key, ciphertext)` + +correspond directly to the [spec](https://pq-crystals.org/). For `kem_encaps` you can optionally provide a custom `m` which is useful for debugging. From 01efb6a714efe93ec189f842cf13ef710cee066b Mon Sep 17 00:00:00 2001 From: Dominik Klein <397515+asdfjkl@users.noreply.github.com> Date: Thu, 8 Sep 2022 15:01:36 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index ff3bcd2..af17722 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,11 @@ Just take a look at `cakem.py`. Functions - `kem_decaps512(private_key, ciphertext)` correspond directly to the [spec](https://pq-crystals.org/). For `kem_encaps` you can optionally provide a custom `m` which is useful for debugging. + +Typical kem would be + +```` +priv, pub = kem_keygen512() +secret1, cipher = kem_encaps512(pub) +secret2 = kem_decaps512(priv, cipher) +````