Quantum cryptography with a photon turnstile