Solution (source code)

= Solution

After transmission Alice and Bob announce <bases>, retain matching-basis bits, reveal a random sample, and abort if its error rate is too large; privacy amplification and error correction produce the key. A Breidbart intercept-resend causes error $1/4$ conditional on matching Alice and Bob <bases>. Since matching occurs with probability $1/2$, one transmitted qubit detects Eve with probability $1/8$.