In a data processing device, a first key is produced based on a secret key
so that the latter is never used in a clear form. In a preliminary step,
the secret key and a random number are applied to a function producing a
first key. The first key and the random number are pre-stored in the
device. For each data processing, the first key and another random number
are applied to another function to produce a second key, and the second
key and the stored number are applied as inverse of the function to
produce a third key used for processing the data. The device can be a
smart card and the data the confidential code presented to the card.