Commit Graph
11 Commits
Author SHA1 Message Date
Radek 8ac9ab92eb Add FIPS 140-2 health checks on raw frames
Add health.py with monobit, runs, and long-run tests (FIPS 140-2 Annex C
thresholds for a 20000-bit sample). Wire into entropy.py so raw JPEG
bytes are tested before hashing; a frozen or degraded camera frame is
rejected and not used to seed the DRBG. Runs thresholds are doubled
because we count 0-runs and 1-runs together. Add --no-health to disable.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-08-31 09:42:12 +01:00
Radek 239672ca63 Fix core RNG: seed HMAC-DRBG from camera frame hash
The previous version computed a SHA-256 of the frame into a variable
named `entropy` and then discarded it, drawing instead from the OS
CSPRNG via secrets.randbits(). The camera contributed nothing.

Replace with a NIST SP 800-90A HMAC-DRBG seeded from the frame hash so
the camera genuinely contributes entropy. Add --interval for loop
rate control, --out for writing raw bytes to a FIFO, mutual exclusion
of --loop/--single, and bit-multiple validation.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-08-31 09:41:12 +01:00
Radek a2dedb502e notes 2026-04-20 09:08:16 +01:00
Radek 9703eb7b9a bufer fix 2026-03-12 13:07:41 +00:00
Radek 853dceda87 random loop n flags 2026-03-12 10:25:06 +00:00
Radek ce4c9d9cbc random loop n flags 2026-03-12 10:18:21 +00:00
Radek ab36b50a30 random loop 2026-03-12 10:17:18 +00:00
Radek 139f74c530 more entropy 2026-03-12 09:42:53 +00:00
Radek 3f035dea5a more entropy 2026-03-12 09:39:24 +00:00
Radek dda1ecf619 initial scripts 2026-03-11 15:45:22 +00:00
rama 3dc3affb46 Initial commit 2026-03-11 15:41:06 +00:00