We study a general quantum key distribution protocol in higher dimension. In
this protocol, quantum states in arbitrary g+1 (1≤g≤d) out of all
d+1 mutually unbiased bases in a d-dimensional system can be used for the key
encoding. This provides a natural generalization of the quantum key
distribution in higher dimension and recovers the previously known results for
g=1 and d. In our investigation, we study Eve's attack by two slightly
different approaches. One is considering the optimal cloner for Eve, and the
other, defined as the optimal attack, is maximizing Eve's information. We
derive results for both approaches and show the deviation of the optimal cloner
from the optimal attack. With our systematic investigation of the quantum key
distribution protocols in higher dimension, one may balance the security gain
and the implementation cost by changing the number of bases in the key
encoding. As a side product, we also prove the equivalency between the optimal
phase covariant quantum cloning machine and the optimal cloner for the g=d−1
quantum key distribution