Utilities - someburner/pyhy GitHub Wiki

pyhy provides a few high-level helpers to aid in developing/debugging.

Hex conversions

  • hexify(binarr): Convert binarr to a hexadecimal string, suitable for printing.
  • unhexify(hexstr): Convert hexstr to a bytes object, suitable for input to hydro_ methods.

Example: You have some hex-encoded cipher text and secretkey is loaded-

cipher_text = 'd590db28a66a7cf932d817659e67b54c7a3792ea71515a12990ac38d88c48c6c3193d53eacedbeece46ffe27e9d6f4fed52abc5dc84c86f7b98d169eb8226d36'
plain_text = hydro_secretbox_decrypt( unhexify(cipher_text), 0, 'context1', secretkey)