states ($B$ embedding a classical variable), we have the opposite situation, i.e., $D(A|B)=0$ and $%
D(B|A)>0$.

*Device-dependent QKD protocols.– *Any QKD protocol can be recast into a measurement-based scheme, where Alice sends Bob part of a bipartite state, then subject to local detections. Adopting this representation, we consider a device-dependent protocol where extra noise affects Alice’s state preparation, as in Fig. \[picU\] (this is generalized later). In her private space, Alice prepares two systems, $A$ and $a$, in a generally mixed state $\rho_{Aa}$. This state is purified into a 3-partite state $\Phi_{PAa}$ with the ancillary system $P$ being inaccessible to Alice, Bob or Eve.

System $a$ is then sent to Bob, who gets the output system $B$. From the shared state $\rho_{AB}$, Alice and Bob extract two correlated variables: System $A$ is detected by a rank-1 POVM $\{M_{x}\}$, providing Alice with variable $X=\{x,p_{x}\}$, while $B$ is detected by another rank-1 POVM $%
\{M_{y}\}$, providing Bob with variable $Y=\{y,p_{y}\}$, whose correlations with $X$ are quantified by the classical mutual information $I(X,Y)$.

![Device-dependent protocol with preparation noise. Alice prepares a generally-mixed input state $\protect\rho_{Aa}$, which is purified into a state $\Phi_{PAa}$ by adding an extra system $P$ inaccessible to all parties. System 