  Throughout history, every advance in encryption has been defeated by advances
in hacking with severe consequences. Quantum cryptography holds the promise to
end this battle by offering unconditional security when ideal single-photon
sources and detectors are employed. Unfortunately, ideal devices never exist in
practice and device imperfections have become the targets of various attacks.
By developing up-conversion single-photon detectors with high efficiency and
low noise, we build up a measurement-device-independent quantum key
distribution (MDI-QKD) system, which is immune to all hacking strategies on
detection. Meanwhile, we employ the decoy-state method to defeat attacks on
non-ideal source. By closing the loopholes in both source and detection, our
practical system, which generates more than 25 kbit secure key over a 50-km
fiber link, provides an ultimate solution for communication security.
