pseudo-random number
A number produced by a formula that looks random but is completely determined by where the sequence started.
Pseudo-random values can be predicted, so using them for passwords or tokens lets attackers guess secrets.
In more detail
Python's random module uses the Mersenne Twister algorithm, which is fine for games and simulations but predictable to an attacker who sees enough output. For passwords, tokens and anything secret use the secrets module.
Related terms
- random module — The standard library module for pseudo-random numbers and random choices, such as randrange(10) or choice(colours).
- random seed — The starting value of a pseudo-random number generator; the same seed always produces the same sequence of numbers.
- secrets module — The standard library module for generating random values that are safe to use as passwords, tokens and other secrets.
Taught in
- Colours, Custom And Random — Hands-on Python: Complete Video Course & Book
- Dates, Times And Random — Hands-on Python: Complete Video Course & Book