import hashlib def sha256_encrypt(data): sha256 = hashlib.sha256() sha256.update(data.encode('utf-8')) return sha256.hexdigest() data = "Hello, world!" encrypted_data = sha256_encrypt(data) print(encrypted_data)