1. Method to prove authenticity of execution of program instructions, comprising: a step of executing program instructions under control of a security program ( 403 ) on a security device ( 103 , 202 ) comprising a random function ( 104 , 203 ), the random function being accessible only from the security program through a controlled interface, the controlled interface comprising at least one primitive function accessing the random function that returns output that depends on at least part of a representation of at least those parts of the security program that call the primitive function, a step of, using the random function, computing proof results during execution of the security program operating in a first mode ( 404 ) by accessing the random function through the controlled interface, and a step of, using the random function, verifying the proof results during execution of the same security program operating in a second mode ( 405 ) by accessing the random function through the controlled interface.