3575 views|6 replies

9720

Posts

24

Resources
The OP
 

[NUCLEO-L4R5ZI Review] Comparison of STM32's true random number and computer's pseudo random number [Copy link]

It is said on the Internet that in most cases, random numbers generated by computer software are calculated pseudo-random numbers, and there are certain rules.
For this reason, there is an organization called random.org that specializes in providing true random number services. It is said that they are generated through atmospheric noise.
The STM32 manual says that the RNG module of STM32L4R5 generates true random numbers, and uses the noise source of the analog circuit as the seed of the random number.
[attach]342582 [/attach]
I checked some information on the Internet and saw that many people said that there are certain patterns in pseudo-random numbers.
There is a blog introducing the true random number generator of Raspberry Pi, comparing the RGB images generated by true random numbers and the RGB images generated by pseudo-random numbers.
It has been reposted and translated many times.
This is the true random number image generated by the author.
This is a pseudo-random number image generated by the author
The pseudo-random image generated by the author is all vertical bars and looks very regular. Is this the real situation?
I first use C# to write a project to generate images from an array. Fill in the array generated by STM32 in the initialization to generate a .bmp image in the specified directory
Because the rate at which STM32 outputs data through the serial port is limited, I set the image size to 200*200 pixels, and each pixel corresponds to 3 bytes for R, G, and B colors
If cancelbyteArray= (byte)random.Next(255);The comment uses the random number generated by the computer's random number generator to generate the image
STM32Use the RNG project, add serial communication, generate random numbers, perform modulus operations, and send the results to the PC
After the serial port assistant receives the data, copy the array received by the serial port assistant and add it to the array of the C# project
Using this method, 3 true random number images and 3 pseudo random number images are generated
Two of the following 4 pictures are generated by STM32, and the other two are generated by PC. Can you guess which two are generated by STM32?
Or should I stitch these 4 images into one without any overlap?
The file names with "rng" in the compressed file are generated by STM32, and those with "random" are generated. If you are interested, you can have a look. Can you find the difference between true random and pseudo random?
random2.rar (806.82 KB, downloads: 4)
I have tried some methods but couldn't find the difference between the two. The experimental results show that pseudo random may have certain rules, but it is not as obvious as written in that post

image001.png (55.82 KB, downloads: 0)

image001.png
This post is from stm32/stm8

Latest reply

I think it has something to do with the c that guy wrote  Details Published on 2018-1-30 11:51
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 

9720

Posts

24

Resources
2
 
AN4230 STM32 microcontrollers random number generation validation using NIST sta.pdf (517.02 KB, downloads: 0)
This post is from stm32/stm8
 
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 

2146

Posts

8

Resources
3
 
Nice experiment. The impression of pseudo-randomness is that the cycle period is very long, but I have never studied how long it is
This post is from stm32/stm8
 
Personal signature坐而言不如起而行
 

120

Posts

0

Resources
4
 
Is it possible that only the correct cycle can produce a more regular pattern?
This post is from stm32/stm8
 
 
 

7462

Posts

2

Resources
5
 
Nowadays, most PC systems are truly random. They take events, such as mouse clicks, disk network interruptions, keyboard strokes, etc., and usually use them as a random number pool. When you need one, you can take one out and return it to you.
This post is from stm32/stm8

Comments

I checked some information and it said that this is done using a specific function in Linux. I'm not sure about Windows. You can try it on Alibaba Cloud virtual host to see what happens without a mouse.  Details Published on 2018-1-29 16:47
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

9720

Posts

24

Resources
6
 
freebsder posted on 2018-1-29 13:30 Nowadays, most PC systems are also truly random, taking events, such as mouse clicks, disk network interruptions, keyboard strokes, etc., usually as a...
I checked some information and it said that Linux uses a specific function to do this, but I'm not sure about Windows. You can try it on Alibaba Cloud virtual host to see what the effect will be without a mouse.
This post is from stm32/stm8
 
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 

3414

Posts

0

Resources
7
 
I think it has something to do with the c that guy wrote
This post is from stm32/stm8
 
Personal signature

So TM what......?

 

 

Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list