pub struct KeychainTimingSource {
pub config: KeychainTimingConfig,
}Expand description
Harvests timing jitter from Security.framework keychain operations.
§What it measures
Nanosecond timing of keychain operations (SecItemCopyMatching or SecItemAdd/Delete) that traverse the full Apple security stack.
§Why it’s entropic
Every keychain operation travels through multiple independent physical domains:
- XPC IPC to securityd — scheduling/dispatch jitter
- securityd processing — SQLite database lookup, access control evaluation
- Kernel scheduling — context switches between our process and securityd
- Database I/O — SQLite page reads from the keychain database file
The write path additionally involves APFS copy-on-write and NVMe controller timing. The read path may or may not traverse the Secure Enclave depending on the item’s access control policy.
§What makes it unique
No prior work has used keychain operation timing as an entropy source. The round-trip through XPC IPC, securityd scheduling, and database I/O aggregates jitter from multiple independent domains in a single measurement.
§Caveats
- High autocorrelation at lag-1 (~0.43): variance extraction mitigates this
- Warm-up effect: first ~500 reads are slower due to securityd cold caches
- Slow: ~0.6ms per sample, not suitable for high-throughput collection
§Configuration
See KeychainTimingConfig for tunable parameters.
Fields§
§config: KeychainTimingConfigSource configuration. Use Default::default() for recommended settings.