Encrypting a hex file


I have converted my image to hex and I have zymkey 4i on my raspberry pi. Where can I find your python API for encrypting a hex file? I have the general API documentation but I am not sure which part is related to my question. Any help is appreciated. Thanks

The APIs that you are looking for are lock and unlock. For example:

import zymkey
import filecmp

zymkey.client.lock("my_plaintext_file", "my_encrypted_file")
zymkey.client.unlock("my_encrypted_file", "my_decrypted_file")

if filecmp.cmp("my_plaintext_file", "my_decrypted_file"):
   print("PASS: original and decrypted files are the same")
   print("FAIL: original and decrypted files differ")

Note that it doesn’t matter what the file contents are - hex ascii vs. straight binary is all the same for lock/unlock.

1 Like