Quantum privacy amplification and the security of quantum cryptography over noisy channels