Codes and ciphers are all about keeping secrets. By nature, being a spy has to be a secret. If people know that the spy is looking for information, they won't tell their own secrets. If they get caught with secret information, spies wouldn't be able to do their job or their life could be in danger.
To protect the secrets that they gather, spies use codes and ciphers- secret ways to write things down. If they enemy finds their paper, they will see nonsense. They will not recognize the sensitive information that is being shared. Codes are used in other situations as well and not just by spies.
When you are a spy, your main job is to find out information and pass it on to the person who needs it most.
In war time, this may be the general or president. If you are spying for money, the spy might pass on the information to their boss.
Either way, getting caught isn't an option. Spies that are caught during a war can be put in jail or even killed. Other spies will almost certainly have consequences that won‘t be that fun.
For this reason, spies use secret ways to communicate, known as codes or ciphers. They do this to protect the information and to protect themselves.
Secret codes have been used for centuries! The first known cipher in history was developed by the Roman leader Julius Caesar. His code was very simple. In fact, you could probably crack it, if you took a bit of time. He just replaced one letter of the alphabet with another and it never changed. However, his enemies didn't catch on very quickly. A code was still a new idea!
As people became smarter about the idea of codes, harder ciphers were developed. An Italian, named Leon Battista Alberti, made a new invention, called a cipher wheel. This had two circles, both engraved with alphabet letters. When you matched each wheel in a certain way, a code could be both created and cracked. However, if the enemy didn't know where to match the wheel, you could hide some pretty good secrets, even if they had a similar wheel!
As time progressed, codes and ciphers have gotten more and more sophisticated. Technology began to be used to make more complicated codes. They have even been used for everyday people, who weren't spies. When the telegram was used to send messages, they charged by the word. You could write up to ten letters in a word for the same price. To cut costs, people made up codes. A group of letters meant a certain phrase. If you stop and think about it, we still use codes in this way today. Just think about the last text message you sent!
There are many different types of codes and ciphers. A code is a system where a symbol, picture or group of letters represents a specific alphabetical letter or word. A cipher is where a message is made by substituting one symbol for a letter.
Some common codes that have been used by spies: