  Cryptographic key exchange protocols traditionally rely on computational
conjectures such as the hardness of prime factorisation to provide security
against eavesdropping attacks. Remarkably, quantum key distribution protocols
like the one proposed by Bennett and Brassard provide information-theoretic
security against such attacks, a much stronger form of security unreachable by
classical means. However, quantum protocols realised so far are subject to a
new class of attacks exploiting implementation defects in the physical devices
involved, as demonstrated in numerous ingenious experiments. Following the
pioneering work of Ekert proposing the use of entanglement to bound an
adversary's information from Bell's theorem, we present here the experimental
realisation of a complete quantum key distribution protocol immune to these
vulnerabilities. We achieve this by combining theoretical developments on
finite-statistics analysis, error correction, and privacy amplification, with
an event-ready scheme enabling the rapid generation of high-fidelity
entanglement between two trapped-ion qubits connected by an optical fibre link.
The secrecy of our key is guaranteed device-independently: it is based on the
validity of quantum theory, and certified by measurement statistics observed
during the experiment. Our result shows that provably secure cryptography with
real-world devices is possible, and paves the way for further quantum
information applications based on the device-independence principle.
