Thursday 29 February 2024

Codes, cryptography and the Russo Japanese war

 


International telegraph lines in the 1870s
Here's a little bit of a puzzle.

By the early 1870's the telegraph network, the internet of its day, was essentially complete. Some links had still to be completed such as the link from Darwin via Batavia (now Jakarta) to Singapore, or indeed the line across Siberia to Vladivostok and on to Beijing, but we can say that by 1880 the global network was complete.

Everything went across the network and the technology used made intercepting messages trivial.

Everyone knew that telegrams,  like postcards  were not really private, so people sometimes encoded messages in simple ways both to keep the word count down and hide the contents of the message.

I can remember my father, who was an engineer surveyor, someone who inspected and certified industrial plant on behalf of insurance companies, having a list of codes pinned up in his home office to allow him to send a confidential telegram warning of a major incident - so that a three word message such as 'egg fish bean' might mean 'explosion, severe damage, no loss of life'.

Sometimes, as telegrams were paid for by the word, encryption was simply a way to reduce costs as in the 'Silk Dress Cryptogram'.

Government and other official correspondence was often encrypted using a variety of ciphers, to preserve secrecy. and where possible, secure routings were used, such as the Indian Ocean Telegraph, built to securely link British possessions in India and South East Asia, and avoiding an overland link via Constantinople and Teheran.

Likewise, the Trans Siberian telegraph would have provided a secure link between St Petersburg and the large Russian naval base in Vladivostok.

Vladivostok has the major disadvantage that it is not ice free, and after a variety of machinations, the Russians persuaded the Qing state to grant them the lease of the Liaodong peninsula, where they built a naval base at Dalian.

Imperial Japan also sought control over the area, not least because Russia posed a threat, especially since the building of a railway across Manchuria via Harbin to Dalian. Eventually these disputes escalated to a full scale war in 1905, a war that Russia decisively lost to Japan. 

Russia and Japan also duelled over Korea, with Russia initially seeking control over the whole Korean peninsula. After 1905 Russia was in no position to try to maintain Korea as a buffer state between itself and Japan, leading to the Japanese occupation of Korea in 1910.

Now, during the Crimean war some fifty years before, Britain, thanks in part to Charles Babbage, had successfully cracked the Russian telegraph codes allowing them to read Russian diplomatic correspondence.

So far, so good.

But reading about the Russo Japanese war a few days ago - yes, another Manchurian rabbit hole - I came across a comment that the British helped the Japanese by reading Russian messages sent via India and Malaya. This story is repeated in several places but I have been unable to track down a source to the story.

This suggests that the Russians were still using a variant of the Vignère cipher some fifty years later, despite Kasiski having published a technique for cracking Vignère ciphers in the 1870s.

Or maybe they weren't - in the absence of a definitive source for the story I don't know.

However it is known that in 1904 HMS Diana, stationed in the Suez canal,  was able to intercept Russian wireless messages ordering the mobilization of the fleet. Unfortunately, there's no publicly available information as to how the messages were encoded. Common sense suggests that the Russian would have encoded their messages using the same method as they used to encode telegraph messages, but given the use of radio for ship to shore communications was still highly experimental its possible that the Russians did not use a strong encryption method.

That's the first puzzle, the second one is slightly more interesting - what exactly were the telegraph messages the British were decrypting? The Russians after all had their own secure telegraph line to Vladivostok and had control of the railway (and the telegraph line) via Harbin.

And then I remembered the mad journey of the Russian Baltic fleet.

With much of the Pacific fleet trapped at Dalian by the Japanese navy, the Russians decided to send the Baltic fleet halfway around the world to break the Japanese navy's blockade.

And, as we can see from this newspaper report of the time, the fleet passed through the Straits of Malacca and rounded Singapore and was presumed to be heading across the Gulf of Thailand towards what is now Vietnam and was then French Indochina.

Crucially, the report also mentions that the Russian consul sailed out to the fleet and handed over dispatches - I can only assume that these must have included instructions from St Petersburg and information on the course of the war so far, and that this was the information the British passed to the Japanese ...