Security of advanced quantum key distribution protocols in realistic conditions