We have developed a new class of superconducting single-photon detectors (SSPDs) for ultrafast counting of infrared (IR) photons for secure quantum communications. The devices are operated on the quantum detection mechanism, based on the photon-induced hotspot formation and subsequent appearance of a transient resistive barrier across an ultrathin and submicron-wide superconducting stripe. The detectors are fabricated from 3.5-nm-thick NbN films and they operate at 4.2 K inside a closed-cycle refrigerator or liquid helium cryostat. Various continuous and pulsed laser sources have been used in our experiments, enabling us to determine the detector experimental quantum efficiency (QE) in the photon-counting mode, response time, time jitter, and dark counts. Our 3.5-nm-thick SSPDs reached QE above 15% for visible light photons and 5% at 1.3 - 1.5 μm infrared range. The measured real-time counting rate was above 2 GHz and was limited by the read-out electronics (intrinsic response time is <30 ps). The measured jitter was <18 ps, and the dark counting rate was <0.01 per second. The measured noise equivalent power (NEP) is 2 x 10-18 W/Hz1/2 at λ = 1.3 μm. In near-infrared range, in terms of the counting rate, jitter, dark counts, and overall sensitivity, the NbN SSPDs significantly outperform their semiconductor counterparts. An ultrafast quantum cryptography communication technology based on SSPDs is proposed and discussed.