Two methods for random number generation are modified to make them more
resistant to attacks by current measurements. The methods are
particularly designed to be implemented in electronic devices such as
smart cards, PCMCIA, badges, contactless cards or any other portable
device. The DES algorithm is encrypted using a key K having a value D
representing date information, to generate an integer variable I. For j
ranging from 1 to m, the following steps are carried out: substituting s
with s XOR I; introducing in the integer variable y the result of the
encryption of s with the DES algorithm using the key K; introducing in
x.sub.j the result of y or s; substituting s with y XOR I; and
introducing in s the result of the encryption of s with the DES algorithm
using the key K. The sequence (x.sub.1, x.sub.2, x.sub.m) is then
restored in the output.