Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from cryptography.fernet import Fernet
- key = Fernet.generate_key()
- key = b''
- input_file = 'test.txt'
- output_file = 'test.encrypted'
- with open(input_file, 'rb') as f:
- data = f.read()
- fernet = Fernet(key)
- encrypted = fernet.encrypt(data)
- with open(output_file, 'wb') as f:
- f.write(encrypted)
- "Fernet key must be 32 url-safe base64-encoded bytes."
- ValueError: Fernet key must be 32 url-safe base64-encoded bytes.
- hello john with id no 345678 with phone no 12345678
- hello peter with id no 87654 with phone no 45678990
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement