Reduction theory of lattices and its applications to cryptography and coding theory