In ancient times, when an important message was transmitted, one had to consider the chance that the message could be interpreted by the enemy. The fate of the state often depended on the ability to encrypt information and decipher the secret codes of the enemy. In the modern world it has become even more difficult. At every turn, people face problem to protect information whether banking transactions or personal computer data. Here too encryption is used, in which prime numbers play a major role.