Heisenberg's uncertainty principle in its most general form is a statement about the measurement uncertainty (or variance) of so-called non-commuting variables.
In quantum mechanics, everything you can observe (such as the polarization of a photon) is represented by a so-called operator. By performing a measurement, you act with an operator on a quantum state.
Two operators $A$ and $B$ are said to commute if $AB = BA$. In simple terms, for commuting operators it doesn't matter whether you first measure $A$ and then $B$ or first measure $B$ and then $A$.
If, however, the operators do not commute, then the order matters: If you measure first $A$ and then $B$, you get a different outcome than if you measure first $B$ and then $A$.
One example is position and momentum: If you measure the position first, then the momentum will have a very high uncertainty. If you measure momentum first, then position will have a very high uncertainty.
The relevance for quantum cryptograhpy now is that measuring the polarization angle in a basis $1$ and measuring it in a basis $2$ corresponds to two non-commuting operators. This means that Eve measuring with basis $2$ before Bob measures with basis $1$ will lead to different outcomes than if Eve would do nothing. Heisenberg basically says that if Eve measures in basis $2$, then the uncertainty of the observable "Polarization in basis 2" is zero and therefore the uncertainty of the observable "Polarization in basis 1" must be at a maximum, i.e., Eve has completely messed up the state of the photon for basis $1$.