A quantum key distribution scheme based on tripartite entanglement and violation of CHSH inequality