Open Startonix opened 4 months ago
encryption_example.py
from cryptography.fernet import Fernet
key = Fernet.generate_key() cipher_suite = Fernet(key) encrypted_text = cipher_suite.encrypt(b"Secret Data") decrypted_text = cipher_suite.decrypt(encrypted_text)
print(f"Encrypted: {encrypted_text}") print(f"Decrypted: {decrypted_text}")
encryption_example.py
from cryptography.fernet import Fernet
key = Fernet.generate_key() cipher_suite = Fernet(key) encrypted_text = cipher_suite.encrypt(b"Secret Data") decrypted_text = cipher_suite.decrypt(encrypted_text)
print(f"Encrypted: {encrypted_text}") print(f"Decrypted: {decrypted_text}")