An English lit professor at Vassar, Don Foster has been called "the world's first literary detective" for his role in the analysis of various texts to determine their authors. His 2000 book Author Unknown: On the Trail of Anonymous is a compilation of some of the most high-profile cases he's been involved with, from the attribution of a Shakespeare poem for his dissertation project to the discovery of journalist Joe Klein as the man responsible for Primary Colors and the rejection of Clement Clarke Moore as the composer of "'Twas the Night Before Christmas."
Literary attribution/forensics is a growing field, and Foster's discussion of its usefulness is extremely interesting. Peppered with wry asides and wordplays, Foster makes what must be a somewhat tedious process of textual analysis seem quite exciting (as it undoubtedly is when dealing with such important subjects). While I enjoyed several of these episodes more than others (the sections on Shakespeare, Joe Klein and the Unabomber were the most fascinating, I thought), the entire book is very much worth a read.
Foster does an excellent job of describing the ups and downs of this type of work, and the constant danger of being one-upped by the discovery of a "new suspect" once an attribution has been made ... or, in the case of contemporary events, having your suspect lie and deny their involvement even as their writing gives them away, as Joe Klein did when Foster fingered him as the author of Primary Colors.
As more and more texts find themselves in electronic form, I suspect that Foster's field will continue to not only grow, but democratize - it will become increasingly difficult if not downright impossible to write anonymously if enough of your words are publicly known and available. As Foster writes in the epilogue, "Until writers can find some other medium than their own language in which to cloak their anonymity, there will always be someone to study the anonymous, or misattributed, text and say - 'Gotcha!'"