Mechanism of Quantum Cryptography