  Measurement-device-independent quantum key distribution (MDI-QKD) is the only
known QKD scheme that can completely overcome the problem of detection
side-channel attacks. Yet, despite its practical importance, there is no
standard approach towards proving the security of MDI-QKD. Here, we present a
simple numerical method that can efficiently compute almost-tight security
bounds for any discretely modulated MDI-QKD protocol. To demonstrate the broad
utility of our method, we use it to analyze the security of coherent-state
MDI-QKD, decoy-state MDI-QKD with leaky sources, and a variant of twin-field
QKD called phase-matching QKD. In all of the numerical simulations (using
realistic detection models) we find that our method gives significantly higher
secret key rates than those obtained with current security proof techniques.
Interestingly, we also find that phase-matching QKD using only two coherent
test states is enough to overcome the fundamental rate-distance limit of QKD.
Taken together, these findings suggest that our security proof method enables a
versatile, fast, and possibly optimal approach towards the security validation
of practical MDI-QKD systems.
