¶ Baileys auth state becomes one encrypted object
Baileys multi-file auth state is serialized, encrypted with AES-256-GCM under CHANNEL_SESSION_KEY, and stored as one object.
channels/{id}/auth.binSession and media storage model
ReplyBox keeps WhatsApp session state and media bytes in object storage, but encrypts them as separate domains. The paths look similar on purpose; the keys must not.
Baileys multi-file auth state is serialized, encrypted with AES-256-GCM under CHANNEL_SESSION_KEY, and stored as one object.
channels/{id}/auth.binMedia is encrypted separately under MEDIA_OBJECT_KEY using the same AES-256-GCM envelope layout as sessions.
channels/{id}/media/{message_id}Envelope layout
The encrypted object body is stored as an initialization vector, authentication tag, and ciphertext. The layout is shared; the key domain is not.
[iv(12) | tag(16) | ciphertext]
Workspace logos
Uploaded logos are validated (PNG, JPG, and WebP only), decoded, resized to a maximum of 256×256, and re-encoded as WebP before being written to object storage. SVG and other document formats are rejected.
org-logos/{organization_id}/{uuid}.webpBoundary rule
The two keys protect separate domains. Keeping them distinct means leaking either key does not automatically compromise the other class of object.
CHANNEL_SESSION_KEY only for session blobs and MEDIA_OBJECT_KEY only for media objects.
Do not consolidateA shared key collapses the session and media blast radius into one domain.