An apparatus comprising an electronic computer configured to execute or interpret a module for renewing code for a cryptographic algorithm capable of enciphering a piece of data (D) by means of a key (K) to obtain a cryptogram (D*) or decipher a cryptogram (D*) by means of a key (K) to obtain a piece of unencrypted data (D), said code including at least N numerical constants, each numerical constant corresponding to an operand or to a mnemonic of an instruction of the code, a value of said numerical constants being independent of the piece of data (D), the key (K) and the cryptogram (D*), wherein said module to be executed by said electronic computer includes a sub-module for receiving a randomly drawn seed, the size of which, in terms of a number of bits, is at least four times smaller than the number of bits needed to encode the N numerical constants of the cryptographic algorithm, a deterministic generator of numbers, the generator being configured to be initialized with the seed to obtain a sequence of numbers, the size of each number, in number of bits, being at least equal to the number of bits needed to encode the N numerical constants of the cryptographic algorithm, and a builder of cryptographic algorithmic codes, said builder being capable of:
- generating N new numerical constants from the sequence of numbers obtained, and replacing the N numerical constants of the code of the cryptographic algorithm by the N new numerical constants thus generated to obtain a code of a renewed cryptographic algorithm.