Unconstrained key training converged to disjoint sparse supports: 99 percent of each users key energy sat on three or four of the sixteen entries, with pairwise disjoint supports and one numerically dead codebook column. That is an orthogonal slot allocation, so the superposition collapsed into OMA and the key space was far smaller than the dense direction the brute-force study assumes. The main configuration is now the structured Walsh-Hadamard family, which is dense, exactly orthogonal, unit modulus, and already the best family in the key-family table. base_keys generalizes to any key length by truncating the next power-of-two Sylvester order, and the key-length sweep keeps only lengths where the truncated rows stay exactly orthogonal, verified numerically. Also fixes the M-PAM energy normalization in oma_ser_keylen, which used sqrt(6g/(M^2-1)) where unit average symbol energy gives A^2=3/(M^2-1); the closed form was 3 dB optimistic and now reproduces a direct Monte Carlo to 1e-5. Results move accordingly: the proposal now stays below OMA at every SNR and reaches 1.52x at key length 64, while the jamming margin falls to 5.5-6.3 dB and the brute-force curve to 0.59 at a million guesses.
29 lines
1017 B
Python
29 lines
1017 B
Python
"""Run the stages that live outside exp_full, after the main sweep.
|
|
|
|
Order matters: exp_refresh trains its own model around the same base keys,
|
|
exp_kpa and exp_permkpa attack the main configuration, and exp_real_sec
|
|
reuses the main configuration on real token streams. Each writes only CSV.
|
|
"""
|
|
import runpy
|
|
import sys
|
|
import time
|
|
|
|
STAGES = [
|
|
("known-plaintext attack", "exp_kpa.py"),
|
|
("permutation known-plaintext attack", "exp_permkpa.py"),
|
|
("key-refresh layer", "exp_refresh.py"),
|
|
("real token streams", "exp_real_sec.py"),
|
|
]
|
|
|
|
for label, script in STAGES:
|
|
print(f"\n{'=' * 60}\n== {label} ({script})\n{'=' * 60}", flush=True)
|
|
t0 = time.time()
|
|
try:
|
|
runpy.run_path(script, run_name="__main__")
|
|
except Exception as exc: # keep going, report at end
|
|
print(f"[FAIL] {script}: {type(exc).__name__}: {exc}", flush=True)
|
|
sys.exit(1)
|
|
print(f"[done] {label} in {time.time() - t0:.0f} s", flush=True)
|
|
|
|
print("\nall remaining stages complete")
|