  We propose a post-selection technique, based on quantum error detection, for
quantum key distribution (QKD) systems that run over quantum repeaters with
encoding. In such repeaters, quantum error correction techniques are used for
entanglement distillation. By developing an analytical approach to study such
quantum repeaters, we show that, in the context of QKD, it is often more
efficient to use the error detection, rather than the error correction,
capability of the underlying code to sift out cases where an error has been
detected. We implement our technique for three-qubit repetition codes by
modelling different sources of error in crucial components of the system. We
then investigate in detail the impact of such imperfections on the secret key
generation rate of the QKD system, and how one can use the information obtained
during entanglement swapping and decoding stages to maximize the rate. For
benchmarking purposes, we specify the maximum allowed error rates in different
components of the setup below which positive key rates can be obtained.
