1. A non-transitory machine-readable storage medium having instructions stored therein, which when executed by a computer, cause the computer to perform a method comprising: providing a first code including program data statically embedded in the first code, wherein a first executable code can be generated from the first code, wherein the program data is statically masked but not dynamically masked in the first executable code; providing rewriting code to dynamically mask the program data; determining a code location in the first code for the rewriting code, wherein the code location is located in two or more execution paths of first code, each of the two or more execution paths including at least one of the instructions using the program data; generating second code based on the first code inserted with the rewriting code at the code location; and generating a second executable code from the second code, wherein the second executable code is storable in a non-volatile storage device, wherein the second executable code when stored in the non-volatile storage device includes a static representation of the program data and instructions to use the program data based on a dynamic representation of the program data, wherein the static representation of the program data is generated during compile time of the second executable code, wherein the dynamic representation of the program data is generated during runtime of the second executable code based on the static representation of the program data, the program data dynamically masked via the dynamic representation by the rewriting code, wherein the second executable code when executed by a processor produces an identical result as the first executable code.