[learn about this] Middle School Dropout [and how he] codes [a] chat program that foils [the ability of the] NSA [to] spy [on communication]
http://esl.about.com/od/intermediatereading/a/newsheadlines....
If you want a complete sentence that's more aligned with the meaning and intent of the original headline, try the following. "[A|This] Middle-School Dropout [Codes|Coded|Is Coding] [A] Chat Program That Foils NSA Spying." The one you wrote has some subtle, imperative differences in meaning. Adding "[the ability of the]" is hypercorrective. And it's verbose. "NSA Spying" is appositive speech; it's perfectly normal and understood.