It is true, the National Security Agency created part of the code for Bitcoin.
When you first hear that, it is pretty jarring. It seems like a smoking gun! Case closed, conspiracy theory proven.
But the NSA creates a lot of cryptography code. Some of it works and is widely adopted.
The piece of the Bitcoin code created by the NSA is a hash function called SHA-256. SHA stands for Secure Hashing Algorithm. The hash is the expected outcome. An algorithm can be executed on a piece of data, and the output of that algorithm should match the hash. But you can't figure out what the data was with just the hash. It only works in one direction. And there are enough different combinations that it is virtually impossible for any two pieces of data to create the same hash.
SHA-256 is not unique to Bitcoin and the NSA. It is used widely, including in SSL certificates to encrypt small data files. Even if someone changes one piece of the file, the hash also changes, and the receiving computer will recognize this by comparing the expected hash with the received hash. This prevents data from being intercepted and changed without detection before reaching its final destination.
That is also the premise behind how SHA-256 is used to create new blocks which represent a newly mined Bitcoin. If anyone tries to falsify any preceding block, the chain of blocks–or blockchain–is disrupted, and the hash will not match.
Yes, the NSA created a piece of the Bitcoin code. No, that is not as actually as sketchy as it might seem.
People are concerned that they installed a "backdoor" in the SHA-256 code to hack and manipulate Bitcoin. But the code is open source. It seems unlikely that of all the experienced people and organizations poring over the code, no one would have noticed a vulnerability.
The Bitcoin One World Currency Conspiracy Theory
The government invents Bitcoin to get people excited about digital currency. Then they create their own, or partner with a mainstream bank to create digital cash.