The FULL Guide To Secrets (Module) For Python Developers

preview_player
Показать описание
The secrets module in Python is part of the standard library and provides a suite of functions for generating secure random numbers. This module is particularly useful for security-sensitive applications, such as cryptography and password management, where predictable random numbers can be a security vulnerability.

▶ Become job-ready with Python:

▶ Follow me on Instagram:

00:00 Intro
00:44 randbelow()
01:37 choice()
03:07 randbits()
03:55 token_bytes()
04:43 token_hex()
06:22 token_urlsafe()
07:32 compare_digest()
10:13 SystemRandom()
11:04 Outro
Рекомендации по теме
Комментарии
Автор

Thank you for the well explained video! I’m using secrets for a class project and just by hearing these explanations I’m able to understand it a lot more than before (I’m new to programming).

cjp
Автор

For 9:46 note that we would be hashing our passwords anyway which turn them into fixed length data, so there is actually no vulnerability in proper usage.

aeghohloechu
Автор

This video was really helpful. Thanks for sharing!

hahahumble
Автор

Thank you for the video! Is there a way to pick elements randomly from a list but with different weights in secrets module? - There is a similar functionality in random module but I'd prefer implementing this in the secrets module.

emmanuelschmulewitz
Автор

It's lunch hour but I am craving for breakfast

dingaroo
Автор

What command did you use to format this list during the secrets.choice function?

vontewari
Автор

On making a login program, I made a small GUI for myself that lets me log into my Oracle SQL server and I can view and edit data in my tables through the GUI.

For the login when the user enters username and password (password displays on screen as dots so at least not shown on screen when typed), they are stored in variables which are then passed into the connection string which itself is stored as a variable.

I assume would this be vulnerable to a hacker? Would someone be able to say intercept packets between the GUI and the DB, print the connection variable then print the u/n and password variables.

If so how could I make it more secure?

Granted this is only something running on my own laptop but just trying to think of ways to improve it :)

mokongxm
Автор

Good to know! And great that I used "import random" for my Password Generator ...FAIL 🙂

eigen_art_ich
Автор

0:13 cryptographically secure
1:33 cryptographically secure
2:12 cryptographically secure
3:01 cryptographically secure
9:33 cryptographically secure
10:14 cryptographically secure
10:57 cryptographically secure

goktugyavuzer
Автор

how to some apps have a python enviroment with them when we install them and the client doesnt need to install python in their system, how can we create one

littlenerd
Автор

Can it be used to obscure a video game made in Python by converting into an exe file?

SkyFly
Автор

import secrets

lunch = secrets.choice(["Beans", "Meat", "Pasta"])

print(f"Today I had {lunch}.")

ronnienolan