The original message, consisting of letters of the Russian alphabet and a space (-) between words, is transformed into a digital message by replacing each of its characters with a pair of digits according to the following table:

| A | Б | B | $\Gamma$ | Д | $\mathrm{E}$ | Ж | 3 | И | $\mathrm{K}$ | $\Pi$ | M | $\mathrm{H}$ | $\mathrm{O}$ | $\Pi$ |  |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 |  |
| $\mathrm{P}$ | $\mathrm{C}$ | $\mathrm{T}$ | $\mathrm{y}$ | $\Phi$ | $\mathrm{X}$ | Ц | Ч | IШI | ШЩ | b | Ы | $\because$ | Ю | Я | - |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |

For encrypting the obtained digital message, a segment of a certain sequence with a period of 14765636901636 567490 (it is unknown from which position the sequence starts) is used. During encryption, each digit of the message is added to the corresponding digit of the segment and replaced by the last digit of the resulting sum. Restore the message: 2339867216458160670617315588 (Problem from the site www.cry.ptography.ru.)
To find the original message, first find the digital message obtained from it using the substitution table. According to this table, the digits at odd positions in the digital image of the original message can only be $0, 1, 2$, and 3.

## Solution

To find the original message, we will first find the digital message obtained from it using the substitution table. According to this table, the digits at odd positions in the digital image of the original message can only be $0, 1, 2$, and 3. By sequentially considering these values for each odd position in the digital message using the corresponding digit of the encrypted message, we will find the corresponding variants of the values of the digits of the encryption segment. For this, we will calculate the remainders from the division of the differences between the digits of the encrypted and the variant digital messages:

ordinal number of position $\quad 13579111315171921232527$

![](https://cdn.mathpix.com/cropped/2024_05_06_99ef25effe2e32f29eccg-04.jpg?height=51&width=1155&top_left_y=1298&top_left_x=14)

variant 0 for $\Gamma(\mathrm{k})$

$238714 \quad 8 \quad 6 \quad 6 \quad 0 \quad 1 \quad 3 \quad 5 \quad 8$

variant 1 for $\Gamma(\mathrm{k})$

![](https://cdn.mathpix.com/cropped/2024_05_06_99ef25effe2e32f29eccg-04.jpg?height=48&width=604&top_left_y=1411&top_left_x=567)

variant 2 for $\Gamma(\mathrm{k})$

0165926441843136

variant 3 for $\Gamma(\mathrm{k})$

![](https://cdn.mathpix.com/cropped/2024_05_06_99ef25effe2e32f29eccg-04.jpg?height=49&width=604&top_left_y=1525&top_left_x=567)

According to the condition, the sequence from which the encryption segment is chosen is periodic with a period of 20. From the table of variants of the values of the digits of the encryption segment, we see that the 5th digit of the segment can be 5, 6, 7, or 8, and its 25th digit can be 2, 3, 4, or 5. From this, we get that $\Gamma_{5}=\Gamma_{25}=5$. On the period of the sequence from which the encryption segment is chosen, there are two digits 5: $\mathrm{C}_{5}$ and $\mathrm{C}_{15}$ (at the 5th and 15th positions). Therefore, we will consider two cases. If $\Gamma_{5}=\mathrm{C}_{5}$, then $\Gamma_{7}=\mathrm{C}_{7}=3$. This contradicts the table of variants of the values of the digits of the encryption segment, in which $\Gamma_{7}$ can be $4, 5, 6$, or 7. If, however, $\Gamma_{5}=\mathrm{C}_{15}$, then the corresponding encryption segment is:

1636567490147656369016365674

This segment fits well with the table of variants of the values of its digits. By subtracting the digits of the found segment from the corresponding digits of the encrypted message and replacing the differences with their remainders from division by 10, we will obtain the original message according to the substitution table of pairs of digits to letters:

encrypted message 2339867216458160670617315588

encryption segment

1636567490147656369016365674

digital message

1703300826311514311601050914

original message

S V Y 3 B - P O - R A D I O