sidecheck-core
Library crate behind sidecheck, a
remote timing side-channel auditor. If you're looking for the CLI tool,
see that crate instead — this one is for embedding the same detection
logic in your own Rust code (a custom test harness, a CI check, a
different transport than HTTP, etc.).
What's in here
stats— the statistical core.box_testcompares the low percentile of two timing samples (methodology from Crosby, Wallach & Riedi, "Opportunities and Limits of Remote Timing Attacks", ACM TISSEC 2009), with a bootstrap-resampled confidence interval rather than an assumption of normally-distributed network latency.estimate_jittergives a robust (MAD-based, outlier-resistant) noise estimate, andrequired_samplesdoes the power-analysis math to size a run before you commit to it.sampler(featurehttp, default on) — an HTTP-based sampler:HttpTargetplusrun_interleaved, which measures two classes of request in randomized interleaved blocks (never "all A, then all B") to avoid confounding the result with time-of-day drift or server warm-up. Requiresreqwest; disable thehttpfeature (default-features = false) if you only need the statistics and want to supply your own timing measurements.doctor— pre-flight network-quality diagnostics (median RTT, jitter classification, packet loss, a recommended sample count) built onstatsalone, with no HTTP dependency of its own.report/export— human-readable and machine-readable (JSON/CSV) report formatting.
Example: statistics only, your own timing source
use box_test;
// two vectors of measured elapsed seconds, however you collected them
let class_a: = vec!;
let class_b: = vec!;
let result = box_test;
if result.is_significant
Example: HTTP sampling (default http feature)
use ;
use ;
#
Limitations
Same as the CLI: this can detect a statistically significant timing difference under the tested conditions. It cannot prove one doesn't exist. See the main README for the full discussion, including why a real (non-amplified) timing leak is often not reliably detectable over an actual HTTP round-trip even when it's real at the CPU level.
License
MIT