PYTHON CODING
- waclaw_koscielniak
- Sep 30
- 1 min read
from cryptography.fernet import Fernet
key = Fernet.generate_key()
print("Encryption Key:", key.decode())
cipher = Fernet(key)
message = "Hello, My World!".encode()
encrypted = cipher.encrypt(message)
print("Encrypted String:", encrypted.decode())
decrypted = cipher.decrypt(encrypted)
print("Decryptd String:", decrypted.decode())
[Running] python3 -u "/Users/name/test/test649.py"
Encryption Key: yP2XURhnEE3dfzV64QHvDwejVAdfI43UJvgUrEzXbzo=
Encrypted String: gAAAAABo3BawlcsAVOwfcSXbQBBxw-jTib1FDeY1xDE_gsmhRglxL3x2t4OQ4mK93tZsRfzn-5zDw5NjuUOuwYnHxZ6DGx5LWAFHUj-W8IrlObEPw_4-joM=
Decryptd String: Hello, My World!
[Done] exited with code=0 in 0.091 seconds

Try to verify.