A demonstration of the principles of quantum key distribution (QKD) is performed using a single-photon source in a proof of concept test-bed over a distance of 2 km in standard telecommunications optical fiber. The single-photon source was an optically-pumped quantum dot in a microcavity emitting at a wavelength of 895 nm. Characterization of the QKD parameters was performed at a range of different optical excitation powers. An investigation of the effect of varying the optical excitation power of the quantum dot microcavity on the quantum bit error rate and cryptographic key exchange rate of the system are presented. © 2010 American Institute of Physics.