We report on a realization of a fully automated 20 km quantum key distribut
ion system incorporating real time error correction and privacy amplificati
on protocols carried out via the Internet. Dedicated security analysis agai
nst realistic attacks is used to optimize the system parameters in order to
maximize the secrecy capacity for the communication over the 20 km distanc
e.