Patent ID: 7512936

Claim:
A computer-implemented method comprising: accessing source code that, includes metadata identifying two or more functionally-equivalent implementations of a function defined within the source code; automatically generating multiple versions of diversified source code, each version of the diversified source code being distinct from but functionally equivalent to the accessed source code, wherein automatically generating multiple versions of the diversified source code comprises: identifying locations in the source code where different types of diversification operations can be performed, selecting different permutations of the different types of diversification operations and different identified locations for each of the multiple versions of the diversified code, performing the selected types of diversified operations at the selected locations in each of the multiple versions of the diversified code, identifying the functionally-equivalent implementations of the function defined Within the source code by referencing the metadata, inserting one of the identified functionally-equivalent implementations of the function into each of the multiple versions of diversified source code, wherein a different one of tile functionally-equivalent implementations of the function is inserted in each of the multiple versions, validating an equivalence of results of each of the inserted functions in the multiple versions of the diversified source code, and providing the multiple versions of the diversified source code; compiling each of the multiple versions of diversified source code into multiple versions of diversified machine code, independent of automatically generating the multiple versions of diversified source code; and further diversifying each of the multiple versions of diversified machine code by performing different diversification operations on each of the multiple machine versions of diversified machine code.