The next resident will have the locks changed to a different key to make sure that you cannot enter even though you may know the method. If you are in the battlefield and are receiving current tactical data, you want an algorithm that makes it easy to decipher the message in the heat of battle. On the other hand, you must also assume that your opponent has intercepted your enciphered message and is busy trying to break it. The easier the algorithm you choose, the more often you will have to change the key that unlocks the code - if you want to keep your enemy in the dark. Substitution ciphers replace letters in the plaintext with other letters or symbols, keeping the order in which the symbols fall the same.
Transposition ciphers keep all of the original letters intact, but mix up their order.
The resulting text of either enciphering method is called the ciphertext. Of course, you can use both methods, one after the other, to further confuse an unintended receiver as well. To get a feel for these methods, let's take a look at some ciphers. We use substitution ciphers all the time. The only difference between these and the spy codes is that the above examples are standardized so that everybody knows them.