The textbook contains necessary information about universal and classical algebras, systems of axioms for the basic algebraic structures (groupoid, monoid, semi-groups, groups, partial orders, rings, fields). The basic cryptographic algorithms are described. Error-correcting codes - linear, cyclic, BCH are considered. Algorithms for designing of such codes are given. Many examples are shown. It is put in a basis of the book long-term experience of teaching by authors the discipline «Discrete mathematics» at the business informatics faculty, at the computer science faculty of National research university Higher school of economics, and at the automatics and computer technique faculty of National research university Moscow power engineering institute. The book is intended for the students of a bachelor degree, trained at the computer science faculties in the directions 09.03.01 Informatics and computational technique, 09.03.02 Informational systems and technologies, 09.03.03 Applied informatics, 09.03.04 Software Engineering, and also for IT experts and developers of software products.