Tor was kind of written by the government. The original inventor of the concept of onion routing was Paul Syverson, he works for the United States Navy. Another lead developer is Roger Dingledine, who briefly worked for the NSA. Nick Mathewson is the third original developer, and I am pretty sure he has no ties to the US government. The strongest link Tor has to 'being written by the government' is Syverson participating in its implementation (and being the inventor of the underlying concept). That said, Tor is open source and has a quite large community of hackers who contribute to audits, revisions and updates. Tor is by far the most researched anonymity software in the world. Also, they have never put a provision in Tor to identify people involved with CP, so that is kind of a strange implication. Maybe you are thinking about JAP. Essentially, any backdoor they put in Tor will need to make it past a ton of people. In the case of JAP they were able to put in specific "backdoors" to bust certain targets because the JAP relays are all operated by a small group of people. They didn't really backdoor the code that users were running, rather they installed logging software on several of the relays that watched for connections to sites the government (of various countries) ordered them to log, while ignoring other traffic flows. This is not possible in the case of Tor because there are many thousands of relays and they all use open source software that anyone can audit.