Generating Random Numbers using secrets library in Python
Last time we discussed about Pseudo Random Generators and how they actually work under the hood. Now one might ask that how random were the keys that we generated in the previous OTP cipher code? Well the answer is they were truly random. We have an amazing library in Python that helps in generating true random numbers. There are multiple methods available in the secrets class, which helps us to generate truly random numbers List of functions are as below: l Choice() l Randbelow() l Randbits() l SystemRandom() l Token_bytes() l Token_hex l Token_urlsafe l Compare_digest