Quantum Key Distribution: Basic Protocols and Threats