Résumé : Error filtration is a method for encoding the quantum state of a single particle into a higher dimensional Hilbert space in such a way that it becomes less sensitive to noise. We have realized a fiber optics demonstration of this method and illustrated its potentialities by carrying out the optical part of a quantum key distribution scheme over a line whose phase noise is too high for a standard implementation of BB84 to be secure. By filtering out the noise, a bit error rate of 15.3% +/- 0.1%, which is beyond the security limit, can be reduced to 10.6% +/- 0.1%, thereby guaranteeing the cryptographic security.