In a quantum key distribution (QKD) system, a method of autocalibrating
the gating of a single-photon detector (SPD) unit is disclosed. The
method includes exchanging photon signals (P1, P2) to establish a
bit-error rate (BER). The method also includes performing a detector gate
signal timing scan (314) that varies the signal arrival time (T) to
establish an optimum arrival time (T.sub.MIN) corresponding to an optimum
(e.g., minimum) BER. Detector gate signal timing dithering is then
performed (318). This involves varying the detector gate signal arrival
times about the optimum arrival time to ensure that the QKD system
operates at or near an optimum BER.