We present strong attacks against quantum key distribution schemes whi
ch use quantum memories and quantum gates to attack directly the final
key. We analyze a specific attack of this type, for which we find the
density matrices available to the eavesdropper and the optimal inform
ation which can be extracted from them. We prove security against this
attack and discuss security against any attack allowed by the rules o
f quantum mechanics.