Skip to main content

Module sync

Module sync 

Source
Expand description

Encryption helpers used by the remote command for device-to-device notification relay.

Functions§

decrypt_bytes
Decrypt a base64 payload into bytes using the given code.
encrypt_bytes
Encrypt arbitrary bytes with the given code; returns a base64 payload string.
generate_share_code
Generate a random share code like SC-a3f2b1c4d5e6f7a8b9.
pull_share
Pull {base_url, api_key} from the relay for code. api_key is decrypted with the code. Deletes the entry on success.
push_share
Push {base_url, api_key} to the relay under code. base_url is sent plaintext (not sensitive — it’s just an IP/URL). api_key is encrypted with the share code before sending — the relay never sees it.
validate_share_code
Validate that a share code has the expected format.