Method of modifying an original program contained in a ROM memory and executable by a processor unit of an integrated circuit, the original program including functional parts each associated with an identifier and an input/output point, the method including the steps of: - storing in the programmable read-only memory a block of data containing at least one substitutable functional part that corresponds to one of the functional parts of the original program stored in the ROM read-only memory and that is associated with an identifier corresponding to that of the corresponding functional part of the original program, this storage being affected only in the event of validation of the block of data and the block of data being stored in the programmable read-only memory in the form of at least one pattern successively including the identifier of the substitutable functional part, an indication of the length of the substitutable functional part, the substitutable functional part and an integrity value calculated from the identifier, the indication and the substitutable functional part; - at the time of execution of the original program by the processor unit, before execution of each functional part of the original program, reading the identifier of each substitutable functional part and comparing it to that of the functional part of the original program to be executed and where appropriate executing the substitutable functional part instead of the corresponding functional part of the original program if the integrity of the substitutable functional part is validated before its execution using the integrity value, the block of data being also authenticated before executing the first substitutable functional part to be executed contained in the block of data. - storing in the programmable read-only memory a block of data containing at least one substitutable functional part that corresponds to one of the functional parts of the original program stored in the ROM read-only memory and that is associated with an identifier corresponding to that of the corresponding functional part of the original program, this storage being affected only in the event of validation of the block of data and the block of data being stored in the programmable read-only memory in the form of at least one pattern successively including the identifier of the substitutable functional part, an indication of the length of the substitutable functional part, the substitutable functional part and an integrity value calculated from the identifier, the indication and the substitutable functional part; - at the time of execution of the original program by the processor unit, before execution of each functional part of the original program, reading the identifier of each substitutable functional part and comparing it to that of the functional part of the original program to be executed and where appropriate executing the substitutable functional part instead of the corresponding functional part of the original program if the integrity of the substitutable functional part is validated before its execution using the integrity value, the block of data being also authenticated before executing the first substitutable functional part to be executed contained in the block of data.