vizbase.memo

Module Contents

init_aes(shared_secret, nonce)

Initialize AES instance.

Parameters
  • shared_secret (hex) – Shared Secret to use as encryption key

  • nonce (int) – Random nonce

Returns

AES instance and checksum of the encryption key

Return type

length 2 tuple

encode_memo(priv, pub, nonce, message, **kwargs)

Encode a message with a shared secret between Alice and Bob.

Parameters
  • priv (PrivateKey) – Private Key (of Alice)

  • pub (PublicKey) – Public Key (of Bob)

  • nonce (int) – Random nonce

  • message (str) – Memo message

Returns

Encrypted message

Return type

hex

decode_memo(priv, message)

Decode a message with a shared secret between Alice and Bob.

Parameters
  • priv (PrivateKey) – Private Key (of Bob)

  • message (base58encoded) – Encrypted Memo message

Returns

Decrypted message

Return type

str

Raises

ValueError – if message cannot be decoded as valid UTF-8 string

involved_keys(message)

decode structure.

_pad(raw_message, bs)
_unpad(raw_message, bs)