 Hello and welcome to this presentation of the STM32 Random Number Generator. The features of this peripheral, which is widely used to provide random numbers, will be covered in this presentation. The Random Number Generator, or RNG, integrated inside STM32 products provides random numbers which are used when producing an unpredictable result is desirable. Applications can benefit from the RNG to increase the randomness of numbers or to decrease the possibility of guessing certain values. The RNG peripheral is based on continuous analog noise that provides a random 32-bit value which will be explained in detail later on. The RNG is able to generate a 32-bit random number at an average frequency of RNG CLK40. The data-ready flag is set in the status register when new random data is ready and validated. The RNG verifies the randomness of the provided data. If more than 64 consecutive bits have the same value, 0 or 1, or there are more than 32 consecutive alternating 0s and 1s, a seed error current status flag is set. A clock error current status flag is set if the RNG clock is less than HCLK clock divided by 16. An interrupt source can also be enabled to indicate an abnormal seed sequence or frequency error. This simplified block diagram of the RNG shows its basic functional and control modules. The random number generator is based on an analog circuit made of several ring oscillators whose outputs are XOR'd to generate the seeds that feed a linear feedback shift register in order to produce 32-bit random numbers. The linear feedback shift register is clocked by a dedicated RNG clock signal so that the quality of the random number is independent of the HCLK frequency. The contents of the linear feedback shift register are transferred into the data register when a significant number of seeds have been introduced into the LFS register. In parallel, an error management block verifies the correct seed behavior and the frequency of the RNG source clock. Status bits are set and an interrupt is triggered if an abnormal sequence is detected in the seed or if the RNG frequency is too low. The RNG can be used for a wide range of applications including cryptography, games, and statistical sampling. For example, all the security of cryptography algorithms are connected to the impossibility of guessing the key. So the key has to be a random number otherwise the attacker can guess it. This is a list of peripherals related to the random number generator. Please refer to these trainings for more information if needed. For more details, please refer to application note AN4232 about using the NIST statistical test suite to validate the random numbers generated by a selection of STM32 MCUs.