diff options
Diffstat (limited to 'poc')
| -rw-r--r-- | poc/spike1_crypto.py | 3 | ||||
| -rw-r--r-- | poc/spike3_node.py | 3 | ||||
| -rw-r--r-- | poc/spike4_nat.py | 7 | ||||
| -rw-r--r-- | poc/spike5_client.py | 3 | ||||
| -rw-r--r-- | poc/spike5_node.py | 3 | ||||
| -rw-r--r-- | poc/spike6_gek.py | 7 |
6 files changed, 18 insertions, 8 deletions
diff --git a/poc/spike1_crypto.py b/poc/spike1_crypto.py index 1e8491c..4006506 100644 --- a/poc/spike1_crypto.py +++ b/poc/spike1_crypto.py @@ -243,7 +243,8 @@ print("\n=== Test 7: AES-256-GCM — Keystore encryption ===") def test_aes_gcm_keystore(): # Derive an AES key from Argon2id (as done for keystore unlock) salt = os.urandom(16) - aes_key = Argon2id(salt=salt, length=32, iterations=3, lanes=4, memory_cost=65536).derive(b"password") + aes_key = Argon2id(salt=salt, length=32, iterations=3, lanes=4, + memory_cost=65536).derive(b"password") # Encrypt a mock keystore blob keystore_data = b'{"sk_user": "base64...", "sk_group": "base64..."}' diff --git a/poc/spike3_node.py b/poc/spike3_node.py index 0b6d694..562239f 100644 --- a/poc/spike3_node.py +++ b/poc/spike3_node.py @@ -27,7 +27,8 @@ from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey HUB_URL = "http://meshbay.org" STATE_FILE = Path("node_state.json") # persists keys and tokens between runs -PASS = "✓"; FAIL = "✗" +PASS = "✓" +FAIL = "✗" # ── Key helpers ─────────────────────────────────────────────────────────────── diff --git a/poc/spike4_nat.py b/poc/spike4_nat.py index e34a4c4..ee7485f 100644 --- a/poc/spike4_nat.py +++ b/poc/spike4_nat.py @@ -21,7 +21,9 @@ from pathlib import Path import httpx -PASS = "✓"; FAIL = "✗"; SKIP = "–" +PASS = "✓" +FAIL = "✗" +SKIP = "–" LOCAL_PORT = 19000 MESHBAY_IP = "164.132.246.44" # meshbay.org resolved @@ -229,7 +231,8 @@ async def main(): # May differ from STUN if symmetric NAT actual_ext = seen_ext_addr.replace("('", "").replace("'", "").replace(", ", ":") if endpoint_hint and actual_ext != endpoint_hint: - print(f" ⚠ STUN addr {endpoint_hint} ≠ actual {actual_ext} (symmetric NAT confirmed)") + print(f" ⚠ STUN addr {endpoint_hint} ≠ actual {actual_ext} " + f"(symmetric NAT confirmed)") endpoint_hint = actual_ext else: print(f" {FAIL} No echo received (timeout)") diff --git a/poc/spike5_client.py b/poc/spike5_client.py index 6ac2fba..cc79ebf 100644 --- a/poc/spike5_client.py +++ b/poc/spike5_client.py @@ -27,7 +27,8 @@ from cryptography.hazmat.primitives.kdf.hkdf import HKDF PORT = 19003 CHUNK_INDEX = 0 -PASS = "✓"; FAIL = "✗" +PASS = "✓" +FAIL = "✗" # ── Wire helpers ─────────────────────────────────────────────────────────────── diff --git a/poc/spike5_node.py b/poc/spike5_node.py index b560dc1..cded922 100644 --- a/poc/spike5_node.py +++ b/poc/spike5_node.py @@ -33,7 +33,8 @@ MESHBAY_PORT = 19003 CHUNK_SIZE = 1024 * 1024 # 1 MB TEST_FILE = Path("testfile.bin") STATE_FILE = Path("node_state.json") -PASS = "✓"; FAIL = "✗" +PASS = "✓" +FAIL = "✗" # ── Wire helpers ─────────────────────────────────────────────────────────────── diff --git a/poc/spike6_gek.py b/poc/spike6_gek.py index 3595d6d..e58823b 100644 --- a/poc/spike6_gek.py +++ b/poc/spike6_gek.py @@ -33,7 +33,8 @@ from cryptography.hazmat.primitives.kdf.hkdf import HKDF HUB_URL = "http://meshbay.org" STATE_FILE = Path("node_state.json") -PASS = "✓"; FAIL = "✗" +PASS = "✓" +FAIL = "✗" # ── Key helpers ──────────────────────────────────────────────────────────────── @@ -200,7 +201,9 @@ async def main(): bundle_alice = wrap_gek(gek_raw, pk_alice_x_raw) print(f" {PASS} Wrapped in {(time.perf_counter()-t0)*1000:.2f}ms") print(f" pk_eph : {bundle_alice['pk_eph_b64'][:24]}...") - print(f" wrapped : {bundle_alice['wrapped_b64'][:24]}... ({len(base64.b64decode(bundle_alice['wrapped_b64']))}B)") + wrapped = bundle_alice["wrapped_b64"] + print(f" wrapped : {wrapped[:24]}... " + f"({len(base64.b64decode(wrapped))}B)") r = await c.post( f"{HUB_URL}/v1/groups/{group_id}/members/{state.get('username','node_cbesson')}/gek", |