When a Miami company developing security software for the U.S. Navy noticed lines of code for the program were being altered, it had no idea who was to blame.

But piece by piece, XTec Inc. claims it unraveled a scheme allegedly masterminded by former employee Larry Hembree to copy its software and sell a competing product to the Navy.

Losing the military contract was devastating, said XTec attorney Eduardo Rasco of Rosenthal Rosenthal Rasco Kaplan in Aventura. But the company got some retribution last month when a federal judge ordered Hembree and his consulting firm to pay $5.25 million for misappropriating trade secrets.