The Mission
The first line of defense against network intrusion is a cryptographic key. In this interactive lab, you will write a Python script that automatically generates a highly secure, 16-character password using true randomness.
- Import the
randomandstringlibraries. - Define the pool of acceptable characters (letters, numbers, symbols).
- Action: Type the code below into the terminal on the right and click the â–¶ Run button!
import random
import string
# Define the character pool
chars = string.ascii_letters + string.digits + "!@#$%^&*"
# Generate 16 random characters
password = "".join(random.choice(chars) for _ in range(16))
# Output the result
print("SecureT Key Generated:")
print(password)