Skip to main content

Module cipher

Module cipher 

Source
Expand description

Raw-key NIP-44 v2 sealing — the single symmetric-encryption primitive of the Community protocol. The channel key (message plane) and the server-root key (metadata plane) are both raw 32-byte ConversationKeys; ciphertext is base64’d for carriage in an event’s string content field.

Functions§

open
Inverse of seal: base64-decode then NIP-44-decrypt under the raw key. A wrong key or tampered payload fails the MAC and returns Err.
seal
Encrypt plaintext under a raw 32-byte key, returning base64 for event content.