  The single photon detection efficiency of the detector unit is crucial for
the security of common quantum key distribution protocols like Bennett-Brassard
1984 (BB84). A low value for the efficiency indicates a possible eavesdropping
attack that exploits the photon receiver's imperfections. We present a method
for estimating the detection efficiency, and calculate the corresponding secure
key generation rate. The estimation is done by testing gated detectors using a
randomly activated photon source inside the receiver unit. This estimate gives
a secure rate for any detector with non-unity single photon detection
efficiency, both inherit or due to blinding. By adding extra optical components
to the receiver, we make sure that the key is extracted from photon states for
which our estimate is valid. The result is a quantum key distribution scheme
that is secure against any attack that exploits detector imperfections.
