We prove the security of a quantum key distribution scheme based on transmi
ssion of squeezed quantum states of a harmonic oscillator. Our proof employ
s quantum error-correcting codes that encode a finite-dimensional quantum s
ystem in the infinite-dimensional Hilbert space of an oscillator, and prote
ct against errors that shift the canonical variables p and q. If the noise
in the quantum channel is weak, squeezing signal states by 2.51 dB (a squee
ze factor e(r) = 1.34) is sufficient in principle to ensure the security of
a protocol that is suitably enhanced by classical error correction and pri
vacy amplification. Secure key distribution can be achieved over distances
comparable to the attenuation length of the quantum channel.