We address the robustness of quantum key distribution protocols to imperfections of a quantum channel. Starting from the Gaussian continuous-variable protocols we recapitulate the role of quadrature squeezing in providing security of the key in the noisy channels taking into account the limited efficiency of data processing. We then develop a model of channel noise that allows an equivalent quantification as for the continuous-variable protocols and apply it to the discrete-variable protocols. This allows us to perform the comparison of robustness of the protocols to the channel noise when either continuous- or discrete-variable coding is used. We show that while continuous-variable protocols enforced by arbitrarily strong nonclassicality demonstrate some quantitative advantage in the channels with relatively low losses, the discrete-variable protocols can achieve better tolerance to the channel noise even when using the limited nonclassical resource. The result is promising for planning of integrated secure communication systems.