Quantum cryptography provides a secure way to exchange encryption keys. It uses principles of quantum mechanics like photon polarization and the uncertainty principle to detect eavesdropping. The most common protocol is BB84, where Alice encodes random bits in one of four polarization states and Bob measures them randomly. They compare bases to detect errors from eavesdropping. If no errors, the bits form a shared encryption key known only to them. Quantum key distribution exploits these effects to securely generate encryption keys between two parties.