A computer-implemented method of obfuscating a computer code, the method comprising receiving an original computer program comprising a plurality of code blocks with computer instructions, the original computer program operable on input data within an input space, the original computer program operable to follow an execution path through the plurality of code blocks when receiving the input data, wherein the input space is segmented into at least one segment according to a segmentation, each segment comprising a subset of the input space containing inputs that correspond to a same execution path; and generating an updated computer program based on the original computer program, wherein generating the updated computer program comprises: including a plurality of updated code blocks in the updated computer program; generating selection code operable, during execution of the updated computer program, to select an updated code block of the plurality of updated code blocks in dependence on the input data; and including the selection code in the updated computer program along with transition code involving a transition of an execution point to the updated block selected by the selection code, wherein the original computer program and the updated computer program are operable to generate at least an identical result, which identical result depends on the input data, characterised in that: the selection code is configured to cause the updated computer program to segment the input space according to an updated segmentation, the updated segmentation being different from the segmentation of the original computer program. receiving an original computer program comprising a plurality of code blocks with computer instructions, the original computer program operable on input data within an input space, the original computer program operable to follow an execution path through the plurality of code blocks when receiving the input data, wherein the input space is segmented into at least one segment according to a segmentation, each segment comprising a subset of the input space containing inputs that correspond to a same execution path; and generating an updated computer program based on the original computer program, wherein generating the updated computer program comprises: including a plurality of updated code blocks in the updated computer program; generating selection code operable, during execution of the updated computer program, to select an updated code block of the plurality of updated code blocks in dependence on the input data; and including the selection code in the updated computer program along with transition code involving a transition of an execution point to the updated block selected by the selection code, wherein the original computer program and the updated computer program are operable to generate at least an identical result, which identical result depends on the input data, characterised in that: the selection code is configured to cause the updated computer program to segment the input space according to an updated segmentation, the updated segmentation being different from the segmentation of the original computer program. including a plurality of updated code blocks in the updated computer program; generating selection code operable, during execution of the updated computer program, to select an updated code block of the plurality of updated code blocks in dependence on the input data; and including the selection code in the updated computer program along with transition code involving a transition of an execution point to the updated block selected by the selection code, wherein the original computer program and the updated computer program are operable to generate at least an identical result, which identical result depends on the input data, characterised in that: the selection code is configured to cause the updated computer program to segment the input space according to an updated segmentation, the updated segmentation being different from the segmentation of the original computer program.