Abstract: Disclosed is a method for writing in a non-volatile memory of an electronic entity, the method including the following steps: determining an operational state of the electronic entity; writing a first datum in a first area of the non-volatile memory in case of abnormal operation; writing a second datum in a second area of the non-volatile memory in case of normal operation. The method includes a step for randomly determining a location for the second area from among a plurality of locations for the second area, the writing of the datum in the second area being carried out in the determined location. Also disclosed is a related electronic entity.