A method executed by one or more computing devices for thwarting tampering with software, the method comprising the steps of: receiving source code of the software; dividing the source code into basic blocks; characterized in that the method further comprises: selecting at least one first basic block and at least one second basic block, wherein execution of the at least one first basic block is not dependent on output from execution of the at least one second basic block; modifying the at least one first basic block and the at least one second basic block, wherein the at least one second basic block is modified by extending its outputs and the at least one first basic block is modified by encoding a first computation in the at least one first basic block to be dependent on output from a second computation in the at least one second basic block so that, for said software to function properly, results from the at least one second basic block are required by the at least one first basic block, wherein tampering with the at least one second basic block modifies the output of the second computation in the at least one second basic block and causes the encoded first computation in the at least one first basic block to malfunction by producing a result different than would be produced by the first computation prior to encoding; and applying mixed Boolean-arithmetic MBA transforms to the modified at least one first basic block and the modified at least one second basic block to substitute MBA identities for one or more values in the encoded first computation and one or more values in the second computation. receiving source code of the software; dividing the source code into basic blocks; characterized in that the method further comprises: selecting at least one first basic block and at least one second basic block, wherein execution of the at least one first basic block is not dependent on output from execution of the at least one second basic block; modifying the at least one first basic block and the at least one second basic block, wherein the at least one second basic block is modified by extending its outputs and the at least one first basic block is modified by encoding a first computation in the at least one first basic block to be dependent on output from a second computation in the at least one second basic block so that, for said software to function properly, results from the at least one second basic block are required by the at least one first basic block, wherein tampering with the at least one second basic block modifies the output of the second computation in the at least one second basic block and causes the encoded first computation in the at least one first basic block to malfunction by producing a result different than would be produced by the first computation prior to encoding; and applying mixed Boolean-arithmetic MBA transforms to the modified at least one first basic block and the modified at least one second basic block to substitute MBA identities for one or more values in the encoded first computation and one or more values in the second computation. selecting at least one first basic block and at least one second basic block, wherein execution of the at least one first basic block is not dependent on output from execution of the at least one second basic block; modifying the at least one first basic block and the at least one second basic block, wherein the at least one second basic block is modified by extending its outputs and the at least one first basic block is modified by encoding a first computation in the at least one first basic block to be dependent on output from a second computation in the at least one second basic block so that, for said software to function properly, results from the at least one second basic block are required by the at least one first basic block, wherein tampering with the at least one second basic block modifies the output of the second computation in the at least one second basic block and causes the encoded first computation in the at least one first basic block to malfunction by producing a result different than would be produced by the first computation prior to encoding; and applying mixed Boolean-arithmetic MBA transforms to the modified at least one first basic block and the modified at least one second basic block to substitute MBA identities for one or more values in the encoded first computation and one or more values in the second computation.