I'm a Native American, and this is pretty well-known to us. I also have experience with Chinese language and dialects. I'll explain why I'm mentioning the Chinese part later.
This is a very good example of
security through obscurity. It works until it's figured out. However, there are so few Navajo speakers compared to English speakers, that it would've been incredibly difficult to find native speakers to learn from at the time. How would they know it's the Navajo language to begin with? It sounded alien to them.
While the code may have been simple, it's hard to find people to teach you that code. During WW2, Japanese in America were rounded up and placed in internment camps. Anyone caught sympathizing with them may have been likewise punished. The chances of finding a Navajo turncoat were extremely low.
Why is Encryption stronger than Languages and Dialects?
Regarding encryption, other people such as Thomas Pornin can explain this better than me, but I'll try to show you similarities:
Encryption is like a language. It's sort of like a conversion of one word (or character) to another set of highly different characters. With proper encryption, you can't convert
A -> Z then
Z -> A unless you have the
key. With languages, you can compare words with similar meanings in other languages, and translate accordingly. With languages, your
key is knowing the languages.
With proper encryption, you cannot do this. You cannot put properly-encrypted text into a decryption routine and get the results back. Not without the key. You need the key to decrypt it. With a hash, you can never get the message back, only verify whether or not it's genuine, but those can be vulnerable to collision attacks.
Here are some examples:
Pretend this is Encryption. The "key" to decrypting the
hidden message is to understand both languages. There is
a second hidden message which requires deeper understanding.
Hello -> 你好
Alpaca -> 草泥马
In the case of a hash (one-way), it could act like this:
Bring potter to Naria. The Death Star is ready for our war against the Time Lords.
With a hash, you would have to verify the contents against the message to see if they match. This is not really a method of encryption because you can't return the original message. You may eventually cause collisions as well.
In the case of AES 256 bit (two-way):
[English with key]
Find Potter and bring him to Narnia. The Death Star is ready for our war against the Time Lords.
[AES 256 encryption result]
How are you going to crack these? The same way as languages, actually. The difference is it's much, much harder to crack real encryption. Firstly, mapping a language and creating a translator is much, much easier than mapping an encryption database.
With one-way hashing, you would have to match every single combination of letters for every single encrypted character, to "crack" it, but that isn't going to return the message to you: it's only going to verify that the hash matches the message. With many hashing algorithms, collisions become a problem after a while.
With two-way encryption, you can get the original message back provided you have the key. Kind of like languages. Larger keys will very likely prevent brute force attacks, as with current technology, it would take longer than the estimated life of the universe to crack them. With languages, the "key" is understanding both languages.
This is why the Navajo "code" was cryptographically, "very simple" in comparison. The security through obscurity of the times made it very difficult to crack, but it would be easily very crackable today with current machines.
Having obscure dialects or languages can add an additional layer of "encryption," (note that the quotes indicate it's not really encryption) but, again,
this is security through obscurity, and shouldn't be relied on by itself. In the case of encryption, these algorithms have been tested to be secure by well-educated researchers for a long time. Languages on the other hand, are much easier to learn.
Almost any idiot can learn a language. I'm living proof. Well-educated cryptographers and mathematicians can't crack many strong forms of encryption. What hope does the average layperson have?
Language and Dialect Usefulness
Regarding obscure dialects mentioned in
#2, you can still see such things today. In fact, this isn't the only example of the Japanese getting owned by security through obscurity.
For example, the Chinese military relies on another layer of "encryption" (mind the quotes) -- which is really just
security through obscurity -- with their dialects. During the last war with China, Japan wasn't able to "crack" the Wenzhou dialect because they didn't understand the implementation, and it was used against them.
Side note: considerable effort has been made by organizations such as Phonemica to demask obscure Chinese dialects.
Part of the problem with relying on dialects and languages today is that hacks are everywhere, so chances are high that someone will find your teaching manuals. Computers are at a good point where demasking a language or dialect could be automated in a very short time. On the other hand, real encryption is nigh unbreakable.
Once someone quickly learns your language or dialect, your security through obscurity would disappear very rapidly. This was used for thousands of years, but in modern times, it's not going to be that effective.
Is Security Through Obscurity Completely Invalid?
Despite what I've said, this does add another layer of obfuscation that is technically difficult to break. Even if your encrypted messages are broken, your attacker would still have to spend considerable time mapping it out. While it's child's played compared to proper encryption, security through obscurity does have it's uses, but you shouldn't rely on it entirely anymore.