For 17 years, Matthew Kluger and Garrett Bauer assiduously avoided each other, communicating through a go-between—and over that time, made each other rich in one of the longest-running insider-trading schemes ever uncovered, federal prosecutors alleged Wednesday.

Once they were caught—after allegedly netting $32 million in profits—prosecutors say that Mr. Kluger, a lawyer, and Mr. Bauer, a trader, scrambled to wriggle out of the government net: Burning $175,000 in cash, disposing of a prepaid cellphone in McDonald's trash...