We report the security analysis of time-coding quantum key distribution protocols. The protocols make use of coherent single-photon pulses. The key is encoded in the photon time-detection. The use of coherent superposition of states allows to detect eavesdropping of the key. We give a mathematical model of a first protocol from which we derive a second, simpler, protocol. We derive the security analysis of both protocols and find that the secure rates can be similar to those obtained with the BB84 protocol. We then calculate the secure distance for those protocols over standard fibre links. When using low-noise superconducting single photon detectors, secure distances over 200 km can be foreseen. Finally, we analyse the consequences of photon-number splitting attacks when faint pulses are used instead of single photon pulses. A decoy states technique can be used to prevent such attacks.