pip install PyNacl python import nacl.utils from nacl.secret import SecretBox key = nacl.utils.random(SecretBox.KEY_SIZE) box = SecretBox(key) data = b"Hello World!" encrypted_data = box.encrypt(data) python import nacl.utils from nacl.secret import SecretBox key = b"\x12\x34\x56\x78\x90\xab\xcd\xef\x12\x34\x56\x78\x90\xab\xcd\xef\x12\x34\x56\x78\x90\xab\xcd\xef\x12\x34\x56\x78\x90\xab\xcd\xef" box = SecretBox(key) encrypted_data = b"\xdf\x8a\x03\x4c\x57\x12\x2f\xdd\xf1\xd4\xcb\xb8\x9d\x5a\x4c\xf1\xb6\xfb\x82\x79\x37\x6f\x51\x50\x1d\x23\x43\xd1\x9b\x30\xe2\x99" decrypted_data = box.decrypt(encrypted_data)


上一篇:
下一篇:
切换中文