Skip to content

Repository files navigation

Patterns in randomness: (worrying?) verification codes with repeated digits [STM32C562RE]

STM32/MX2/HAL2 patterns in randomness project

Random ramblings at the BBQ. Humans are wired to find patterns, even where there are no ones. Do not get superstitious. Embrace randomness. Coincidence is part of our life. Do not accredit it to some supernatural entity. It is nature we embace with physics, math and technology. A 6-digit one-time passwords (OTPs) with three or more adjuscent identical digits a couple of times a month if you are a heavy user of online payment systems should not worry you (and it is not a sign, even if it contains 666). On the contrary, if there were no such codes, something would not be truly random there. Randomness is crucial to our security. And because seeing is believing, let us generate some random passcodes.

STM32/MX2/HAL2 patterns in randomness in action STM32/MX2/HAL2 patterns in randomness serial terminal

Tip

Correlation does not imply causation.

Caution

A high correlation may happen by pure chance (this is known as a spurious correlation).

Tip

Coincidences are more likely than you think.

Note

Even an outcome which has a tiny chance of occurring becomes almost certain if you give it enough opportunities.

Tip

"Lottery: A tax on people who are bad at math." Ambrose Bierce

Important

"The first principle is that you must not fool yourself - and you are the easiest person to fool." Richard P. Feynman

Tip

"Any sufficiently advanced technology is indistinguishable from magic." Arthur C. Clarke

Missing files?

Don't worry. Just open the .ioc2 file in STM32CubeMX2 and hit the yellow button to generate the IDE project. Then open the project in STM32CubeIDE for Visual Studio Code and build it.

Some random readings

The old stock forecasting scam:

Send 10,000 people a prediction split 50-50 (half get "stock will rise," half get "stock will fall"). Next round, only the 5,000 who saw the "correct" prediction get another 50-50 split letter. After a few rounds you've got a tiny group who've seen nothing but perfect calls and think you're a damn oracle, at which point you upsell them on "premium insights."

After 7 rounds that group consist of 78 potential victims of the scam.

True random number generators and testers

But what are the odds of such a code in a set of 20 random ones?

Approximately 53%. It is then more probable to get one than not.

Call to action

Create your own home laboratory/workshop/garage! Get inspired by ControllersTech, DroneBot Workshop, Andreas Spiess, GreatScott!, bitluni's lab, ElectroBOOM, Phil's Lab, atomic14, That Project, Paul McWhorter, Max Imagination, Nikodem Bartnik, Stuff Made Here, Mario's Ideas, Aaed Musa, Haase Industries, and many other professional hobbyists sharing their awesome projects and tutorials! Shout-out/kudos to all of them! Promote README-driven learning.

Warning

STM32C5 series - do try it at home and experiment with patterns in randomness ❕

220+ challenges to start from: Control Engineering for Hobbyists at the Warsaw University of Technology.

Stay tuned!

0xBU

About

Patterns in randomness: (worrying?) verification codes with repeated digits demo using STM32/HAL2.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages