Security formulas of quantum key distribution (QKD) with imperfect resources are obtained for finite-length code when the decoy method is applied. This analysis is useful for guaranteeing the security for the implemented QKD system. Our formulas take account into the effect of the vacuum state and dark counts in the detector.
展开▼