How frequently were the codes changed and why didn't the Japanese change their codes before Midway?

How frequently were the codes changed to ensure that army plans, navy etc etc don’t get leaked? And why didn’t the Japanese do so before Midway (yes Hindsight is a 20/20)? If they had changed their codes before planning for Midway, they might have been successful.


Changing codes at that time was a pretty involved procedure, so it wasn’t done as frequently as hindsight shows would have been optimal. You not only have to get the revised encoding/decoding secret documents to all participating network stations in advance, but you also need to allow for human error or unforeseen circumstances preventing some stations from switching over at the designated time. Naval codes in particular are tricky, because your ships are spread all over their areas of responsibility which necessarily stretches out the time period between deciding to change and being able to implement the change. In the German case, it was not just a “software” change of codebooks, but a “hardware” change of the physical Enigma machine rotors.


Excellent points, als codebook/crypto changes should be “instant” to prevent using the messages in the old code to break the new one.

I got a tour from a 94 year old Bletchley girl in 2017 and she told me about the German habit of using “Wettervorsage” in front of Any weather forecast. This makes it fairly easy to find the “e” as there are 3 in predictable positions.

The best coding machines are no good if humans aren’t using it correctly. Go Bletchley girls!

PS I recommend Bletchley Park as a great museum.


ahh… but couldn’t they have changed the codes in the following manner (this is a very dumb idea, but it still seems plausible to me. I am asking so as to remove any doubts on this manner). I will be taking the example of Japan in this case.

Change the codes, relay them to the occupied stations. Now obviously there are ships patrolling an area. So when the have to refuel, give them the old codes. And hence keep on shifting people from the old code team to the new code team. Repeat the same for the air force and the army.


so you are trying to say that the information would eventually be leaked by a human,no matter how many times they changed the code?

PS : how did you get a tour from 94 year old Bletchley girl?


Ideally, you want everyone on the network to cease using the old code and begin using the new code from the same moment. As @Chewbacca noted above, if you “phase-in” the change, you provide any enemy codebreakers with incredibly valuable clues to cracking the new code because some information will need to be transmitted in both old and new codes (providing a veritable Rosetta Stone to the enemy).


Well in 2017 she gave a tour and we had a long discussion on decoding methods and her early IT career later.

Note she like the other girls didn’t know the goal of her work as at the time as it was heavily compartimentalized and very few people had decoding knowledge. She was selected because she passed a puzzle assessment if I remember correctly.


Here are lots of resources, Bletchley is huge and a short train :steam_locomotive: ride from London. Would be a nice TG Meet-up site.

Note: The British National Computer Museum is just around the corner an eg has great :+1: presentations as well such as on the Apollo 11 computer. This shows a lot about IT without Gigabytes


Ahh… I don’t how that skipped me. Thanks!! But does that mean that the codes could only be changed during peace time as a phase-in would leak stuff to the enemy (and it is faster to switch to the new codes in peace time)?


Aah… thanks for the resources!!

I don’t think there will be another TG meet-up site probably till next year because of covid.


No, codes did (and still do) need to be changed on a known schedule especially during wartime. The trick was the planning and organization required to make it happen on that schedule and the communications discipline need to avoid security leaks that the enemy could exploit during and after the code-change


In the book Shattered swords, they mention that the codes were supposed to be changed in the May June timeline but it was delayed by the operations going on.


:crossed_fingers: Here’s hoping…

1 Like

Sorry to revive this older thread, but I wrote back in June 2021:

I may have been over-optimistic to say “at that time”, if this discussion on the current Russian-Ukraininan conflict is accurate:

many people have noted Russia’s lack of air superiority. One reason for that could be that the Ukrainians have captured Russian mobile air defense systems in full working order. Which means they have complete lists of IFF signals, scheduled changes, cryptography settings etc. etc. Now potentially the Russians can change them, but they cannot change them via a radio broadcast because the Ukrainians will listen, so the only way to do an update is via soldiers on the ground hand delivering the updates (yes they could use land lines for some of the journey, but eventually they have to download them from some computer (print them out? copy to a USB drive?) and take them to the actual piece of equipment. Which takes time. Particularly since the vehicles doing the hand delivery have to share the roads with other parts of the Russian invasion force. But as the first link in the paragraph speculates another reason could be that the Russian airforce can’t actually coordinate things so that Ukrainian air defense systems can be targeted as they defend key sites against other Russian air attacks.

So even modern high-tech militaries do not have the ability to switch codes unexpectedly today.

Edit: Oops, forgot the link to the original article -


They did! (I know, surprised me too.). The JN-25 series had a number of versions, the “C” replaced the “B” right after the Coral battle - on May 28th, 1942. But by then, the HYPO codebreakers had gotten what the needed from JN-25B - date and time of the Midway operation. “C” was replaced by “D” in August 1942, by “E” in October 1942, and so on.

The problem for the Japanese Navy was that not everybody would have the same codebook at the same time, so it turned out to be easier to break some messages since they would be sent out in both the new (unbroken) and the old (broken) one. The Japanese Empire was just so large and loosely connected that you’d want fleet units to have the new codes right now, but an anchorage out in the middle of nowhere might not get it for a while.

Hope this helps!