Imperfect detectors for adversarial tasks with applications to quantum key distribution | Synapse