Sometimes the best way to keep vital information out of the wrong hands is to encrypt it so it can only be understood by someone who has the cipher, the key to unlocking the apparently nonsensical puzzle.
Many races use such encryptions in times of war to keep knowledge of such things as troop movements and battle plans from their enemies. They work well enough, at least until said enemies manage to get their hands on the cipher.
The Doctor doesn’t need codes; he simply writes in Gallifreyan. As the last of his race, it’s a language only he understands.