Ransomware races to encrypt as many reachable files as possible before a human or automated defense notices. It has no way to tell which files are real and which are decoys, so it encrypts whatever it finds next, indiscriminately — meaning a canary file scattered anywhere in the tree is just as likely to get hit early as any other file.
A canary (decoy) file defense sprinkles harmless files that are never touched during normal use. A watcher process monitors only those files. The moment ransomware modifies one, the watcher fires — killing the process and isolating the host — long before the scan finishes.
P(canary hit by step k) ≈ 1 − C(N−c, k) / C(N, k)
N = total files, c = canary count, k = files scanned so far
- Canary density — more decoys sprinkled through the tree means the scan statistically trips one sooner, so expected damage drops roughly in proportion.
- Scan speed — how fast the ransomware works through the file list; defense reaction time doesn't change, only how much gets encrypted before detection.
- Files per system — total tree size; a larger tree with the same canary density still gets caught at roughly the same fraction scanned, but a higher absolute file count.
- Canary defense toggle — turn it off to watch the canary-protected run degrade into the same run-to-completion outcome as the undefended baseline.
Both systems share the exact same file layout and scan order each run, so the comparison isolates the effect of the canary trip-wire itself.
Position of first canary K (random order): P(K > k) = C(N−c, k) / C(N, k)
E[K] = (N+1) / (c+1)
E[real files lost] = E[K] − 1 = (N+1)/(c+1) − 1 (response delay d adds ≈ d·(N−c)/N more)
- Self-check: the panel compares this formula with a Monte Carlo of 2000 random scan orders (response delay 0) and flags it when the difference exceeds 4 standard errors.
- Response delay: real watchers take time between the canary write and the kill; here the attack continues for d more files after the first canary is touched.
Honest simplifications: this is a synthetic, defensive-education model. No real encryption happens and no real files are touched. The attacker visits files in a uniformly random order; real ransomware often walks directories in order, targets by extension and may avoid obvious decoys, which changes the odds. Canaries are placed uniformly and are the only monitored files; EDR heuristics, backups and network segmentation are not modelled. Detection is assumed reliable.