The story of WWII British code breakers cracking the German Enigma code machine is fairly well-known. However.....
Also secret, and less well known to this day, was the fact that Britain had Enigma too. That's why the Germans--no slouches at code-breaking--couldn't read British signals.
.......a machine called Typex which looks like Enigma's slightly bigger twin. That's because it was Enigma, which Britain had also bought and adapted. The Germans couldn't penetrate their own system.
The story began in 1928 when the Government Code and Cypher School (GC&CS)--forerunner of GCHQ and then part of MI6--acquired two Enigma machines at the Admiralty's request. The Admiralty inexplicably lost interest but in 1934 Wing Commander Lywood of Air Ministry Signals asked the GC&CS if he might borrow one.
He could, but there was a small catch.
"You may borrow this machine in order that it may serve as a model for your 'engineers'... I must point out that it is probable that this machine is covered by patents taken out in this country...It may be advisable that you consult your patent experts before proceeding to make a direct copy."
There were some patents, but they went ahead anyway, with good results......
Typex remained secure throughout the war and continued in use afterwards.
.....but some legal complications.
Later, Air Ministry Contracts Directorate wrote: "It is suggested that the question of infringement be referred to this branch after the apparatus has been made and used in order that any payment due to the patentee may be considered...no action to settle the matter could be considered while the apparatus is secret."
Which meant - since the patent holder was German company ECA - payment to ECA could be considered only after the forthcoming war was won or lost, in which case there would either be no ECA to be paid or no Air Ministry to pay them.
There was also a British legal claim.
By 1936 the War Office was showing interest in "the RAF Enigma" and the same phrase seems to have been used by a Mr Sidney Hole who wanted to know whether it infringed a patent of his from 1924.
In the best traditions of the bureaucracy it recommended "a suitable non-committal reply" to Mr Hole. In 1937 it admitted to itself that it was infringing patent no. 267472 and concluded......
"difficulty arises in remunerating the patentees... since this would entail a suggestion that the Department is using a cypher apparatus similar in some respects to that to which the patent relates." In other words, we shan't pay what we owe because that would mean admitting to doing that for which we owe.
Now that it's in the open......in these litigious times any inheritors of ECA titles or heirs of Mr Hole might even sue for unpaid royalties.