The article examines the activities of the gendarmerie railway police in the Russian Empire during the peri-od from the last decade of the 19th century to the February Revolution, focusing on their efforts to intercept anti-government correspondence and enemy reports, decrypt them, and protect information about the transportation of military goods. The author uses extensive previously unpublished records from the gendarmerie police de-partments of the railways to analyze examples of secret writing (cryptograms) used by revolutionaries. The dis-advantages of the ciphers used include a logical connection between letters in the source text and positions in conditional alphabets, as well as a specific arrangement of letters that ensures that only one position of the condi-tional alphabet can correspond to each encrypted value. Militant groups of political radicals actively tried to re-cruit railway employees, especially telegraph operators, to cooperate in order to receive and transmit information about the passage of trains with valuable cargo. This information was crucial for planning and implementing expropriation actions. During the First World War, the critical importance of communication increased the im-portance of cryptography and cryptanalysis. To encrypt messages about the state of Russian railways, the enemy used an extensive arsenal of techniques, such as replacing keywords in texts by established methods; using ci-pherbooks containing various code combinations, and a combination of values replacement and rearrangement according to the developed matrices. The war gave an impetus to the development of cryptography, as ciphers became more complicated for cryptanalysts to decipher. The concealment of the contents of spy reports was en-sured not only through the transformation of texts but also through sophisticated methods of packaging infor-mation carriers in luggage, among food products, and the use of special ink. In charge of decryption, the railway gendarmes largely depended on the special department of the Police Department of the Ministry of Internal Af-fairs and the Ministry of War. These agencies provided the necessary keys. In turn, the railway gendarmerie gained valuable experience in intercepting letters containing secrets when they were transported by rail.