The old cliché that “the enemy of my enemy is my friend” is well illustrated by the cryptologic relationship between Poland and Japan.
We lack details about the depth of the relationship, but there is no doubt that it endured over decades.
Both countries viewed Russia, later the Soviet Union, as an enemy.
A sympathetic relationship between Poland and Japan began about the time of the Russo-Japanese War of 1904-05. Poland then was not independent, but was a component of the Russian Empire. Russian officers of Polish ethnicity were captured by the Japanese, and found their negative feelings about Russia were shared by their captors. In the decades that followed, friendly feelings and good relations continued between them.
In the early 1920s, Army officers from newly independent Poland traveled to Japan to tram Japanese cryptologists and help develop a communications intelligence capability. During its war against the USSR to keep its independence, the Polish military had developed an active COMINT capability that supported their war effort at key points.
The Japanese-Polish cryptologic cooperation was aimed directly at Soviet communications. In addition to working with the central government, Polish cryptologists also traveled to Harbin, the capital of Manchukuo (the Japanese puppet state m Manchuria) to support Japanese army COMINT efforts on the Asian mainland.
It IS known that as Poland was attacked by Germany, the Japanese helped some Polish intelligence officers escape. In addition, the Polish government m exile m London approved the long-term residence of a Polish cryptanalyst m Manchukuo to assist the Japanese in monitoring the Soviets. Note that these two incidents occurred even though the Free Polish Government was a member of the Allies and Japan was a partner to Germany — that is, officially they were enemies.