Can the cryptographic algorithm DES be implemented in a electromechanical machine with the technology of the early XXth century?
Of course. There is no reason against.
Except maybe the most important:
I guess it's safe to pinpoint the era asked about as up to 1940, i.e. before the war. At that time data storage was punch cards and decimal values. Neither with a need to encrypt nor the binary base to apply DES like algorithms. Thus no application in computing.
The only area with a possible use for encryption might have been communication. While we today tend to see applications like (Baudot) TTY as binary, they weren't. They were symbol based with a per-symbol serialization that may seeming like binary, but isn't, as it's not representing values. Only a sequence.
DES operates below the level of symbols on binary representation of symbols. This is only possible by translating symbols into binary sequences, manipulating (encrypting) them, followed by re-creation of symbols to be transmitted. And of course reversing the process on receiver side.
Quite contrary to today's technology, where everything is geared to pile up the most simple units (binary) units, as electronics can produce them quite easily, and connections thereof can be made almost indefinite, mechanical computing works best with as few units as possible with the least connections necessary. Making each unit more complex, like using higher order symbols like decimal or letters, is the way to make it go.
Thus any kind of useful encryption machinery should have been symbol based - which is exactly what Enigma-type machines were. In practical use they had several advantages:
- Direct handling of symbols within symbol space (no unnecessary translation hardware)
- Short key phrases (easy to handle for humans)
- Fast operation (not slowing down transmission
- Small machine size (important for mobile use)
All of that would be quite hard, if not impossible, to reach with a binary based algorithm.
In fact, Enigma-type encryption could quite well offer comparable security to DES - if applied right. It can be said that, without any disrespect to the English effort, that German hubris was the most relevant factor in code cracking.
Most important here the practical elimination of most of the codespace (the equivalent of a more than 70 bit code word was reduced to less than 20 bit), redundant messages and fishing. Most of these shortfalls were well known, but accepted. After all, Germany expected to win the war before anyone could come up with useful decoding.