The main problem related to fernet generate key from password is that it is not very secure. If someone knows your password, they can easily generate a key to access your account.
from cryptography.fernet import Fernet key = Fernet.generate_key() print(key)
This code line is importing the Fernet module from the cryptography package. The next line is generating a key using the generate_key() function from the Fernet module. The last line is printing out the key that was generated.
Contents
Fernet
Fernet is a bitter, anise-flavored liqueur. It is made from a blend of two different types of wine, and it is typically served over ice.
Generator
A generator is a special type of function that can produce values automatically. Generators are created by enclosing a function in the generator keyword, and then providing a list of values as the argument to the function.
The function will then return a list of values, one per call, until it reaches the end of its input list. The return value of a generator is not guaranteed to be unique, so care should be taken when using them in code.