Note
For detailed instructions on encrypting the content format using the Double Ratchet algorithm, refer to the smswithoutborders_lib_sig documentation.
-
Email format:
from:to:cc:bcc:subject:body[:access_token:refresh_token]- Example: Gmail
- Square brackets (
[]) indicate optional fields.
-
Text format:
sender:text[:access_token:refresh_token]- Example: Twitter
- Square brackets (
[]) indicate optional fields.
-
Message format:
sender:receiver:message- Example: Telegram
-
Test format:
test_id- Example: reliability ReliabilityTest Specification
Note
For detailed instructions on encrypting the content format using the Double Ratchet algorithm, refer to the smswithoutborders_lib_sig documentation.
Note
All service types use the same structure, but fields not applicable to a specific service type will have their length bytes set to 0, and no value bytes will follow for those fields.
All 2-byte length fields are encoded as unsigned little-endian.
-
Email format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
ccfield. - 2 bytes: Length of
bccfield. - 1 byte: Length of
subjectfield. - 2 bytes: Length of
bodyfield. - 1 byte: Length of
access_tokenfield (optional). - 1 byte: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
ccfield. - Variable: Value of
bccfield. - Variable: Value of
subjectfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- 1 byte: Length of
-
Text format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield (set to0). - 2 bytes: Length of
ccfield (set to0). - 2 bytes: Length of
bccfield (set to0). - 1 byte: Length of
subjectfield (set to0). - 2 bytes: Length of
bodyfield. - 1 byte: Length of
access_tokenfield (optional). - 1 byte: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- 1 byte: Length of
-
Message format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
ccfield (set to0). - 2 bytes: Length of
bccfield (set to0). - 1 byte: Length of
subjectfield (set to0). - 2 bytes: Length of
bodyfield. - 1 byte: Length of
access_tokenfield (set to0). - 1 byte: Length of
refresh_tokenfield (set to0). - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
bodyfield.
- 1 byte: Length of
-
Test format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield (set to0). - 2 bytes: Length of
ccfield (set to0). - 2 bytes: Length of
bccfield (set to0). - 1 byte: Length of
subjectfield (set to0). - 2 bytes: Length of
bodyfield (set to0). - 1 byte: Length of
access_tokenfield (set to0). - 1 byte: Length of
refresh_tokenfield (set to0). - Variable: Value of
fromfield (considered the test ID).
- 1 byte: Length of
Note
For detailed instructions on encrypting the content format using the Double Ratchet algorithm, refer to the smswithoutborders_lib_sig documentation.
Note
All service types use the same structure, but fields not applicable to a specific service type will have their length bytes set to 0, and no value bytes will follow for those fields.
All 2-byte length fields are encoded as unsigned little-endian.
-
Email format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
ccfield. - 2 bytes: Length of
bccfield. - 1 byte: Length of
subjectfield. - 2 bytes: Length of
bodyfield. - 2 bytes: Length of
access_tokenfield (optional). - 2 bytes: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
ccfield. - Variable: Value of
bccfield. - Variable: Value of
subjectfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- 1 byte: Length of
-
Text format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield (set to0). - 2 bytes: Length of
ccfield (set to0). - 2 bytes: Length of
bccfield (set to0). - 1 byte: Length of
subjectfield (set to0). - 2 bytes: Length of
bodyfield. - 2 byte: Length of
access_tokenfield (optional). - 2 byte: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- 1 byte: Length of
-
Message format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
ccfield (set to0). - 2 bytes: Length of
bccfield (set to0). - 1 byte: Length of
subjectfield (set to0). - 2 bytes: Length of
bodyfield. - 2 byte: Length of
access_tokenfield (set to0). - 2 byte: Length of
refresh_tokenfield (set to0). - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
bodyfield.
- 1 byte: Length of
-
Test format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield (set to0). - 2 bytes: Length of
ccfield (set to0). - 2 bytes: Length of
bccfield (set to0). - 1 byte: Length of
subjectfield (set to0). - 2 bytes: Length of
bodyfield (set to0). - 2 byte: Length of
access_tokenfield (set to0). - 2 byte: Length of
refresh_tokenfield (set to0). - Variable: Value of
fromfield (considered the test ID).
- 1 byte: Length of
Note
For detailed instructions on encrypting the content format using the Double Ratchet algorithm, refer to the smswithoutborders_lib_sig documentation.
Note
This format improves efficiency by only including length fields for applicable fields per service type, rather than including all fields with zero lengths.
All 2-byte length fields are encoded as unsigned little-endian.
-
Email format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
ccfield. - 2 bytes: Length of
bccfield. - 1 byte: Length of
subjectfield. - 2 bytes: Length of
bodyfield. - 2 bytes: Length of
access_tokenfield (optional). - 2 bytes: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
ccfield. - Variable: Value of
bccfield. - Variable: Value of
subjectfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- 1 byte: Length of
-
Text format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
bodyfield. - 2 bytes: Length of
access_tokenfield (optional). - 2 bytes: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- 1 byte: Length of
-
Message format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
bodyfield. - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
bodyfield.
- 1 byte: Length of
-
Test format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - Variable: Value of
fromfield (considered the test ID).
- 1 byte: Length of
Note
For detailed instructions on encrypting the content format using the Double Ratchet algorithm, refer to the smswithoutborders_lib_sig documentation.
Note
This format extends V3 by adding support for image content.
All 2-byte length fields are encoded as unsigned little-endian.
-
Email format: Binary-encoded fields with the following structure:
- Variable: Value of
imagefield. - 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
ccfield. - 2 bytes: Length of
bccfield. - 1 byte: Length of
subjectfield. - 2 bytes: Length of
bodyfield. - 2 bytes: Length of
access_tokenfield (optional). - 2 bytes: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
ccfield. - Variable: Value of
bccfield. - Variable: Value of
subjectfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- Variable: Value of
-
Text format: Binary-encoded fields with the following structure:
- Variable: Value of
imagefield. - 1 byte: Length of
fromfield. - 2 bytes: Length of
bodyfield. - 2 bytes: Length of
access_tokenfield (optional). - 2 bytes: Length of
refresh_tokenfield (optional). - Variable: Value of
fromfield. - Variable: Value of
bodyfield. - Variable: Value of
access_tokenfield (if present). - Variable: Value of
refresh_tokenfield (if present).
- Variable: Value of
-
Message format: Binary-encoded fields with the following structure:
- Variable: Value of
imagefield. - 1 byte: Length of
fromfield. - 2 bytes: Length of
tofield. - 2 bytes: Length of
bodyfield. - Variable: Value of
fromfield. - Variable: Value of
tofield. - Variable: Value of
bodyfield.
- Variable: Value of
-
Test format: Binary-encoded fields with the following structure:
- 1 byte: Length of
fromfield. - Variable: Value of
fromfield (considered the test ID).
- 1 byte: Length of
| Version | Hexadecimal Value | Decimal Value | Description |
|---|---|---|---|
| v0 | None |
None |
Legacy format with 4-byte ciphertext length and no version marker. Device ID has variable length without explicit length field. |
| v1 | 0x01 |
1 |
Introduces version marker, 2-byte ciphertext length, explicit device ID length field, and language code support. Uses Content Format V1 with 1-byte token length fields. |
| v2 | 0x02 |
2 |
Same payload structure as V1 but uses Content Format V2 with 2-byte token length fields for better support of longer access/refresh tokens. |
| v3 | 0x03 |
3 |
Same payload structure as V1/V2 but uses Content Format V3 with bitmap-based field presence indication for more efficient encoding. |
| v4 | 0x04 |
4 |
Same payload structure as V1/V2/V3 but uses Content Format V4 with support for image content. |
- Format:
- 4 bytes: Ciphertext Length.
- 1 byte: Platform shortcode. For a list of supported platforms and their corresponding shortcodes, refer to the Supported Platforms section.
- Variable: Ciphertext. (encrypted Content Format V0).
- Variable: Device ID.
Note
For detailed instructions on using the Double Ratchet algorithm to create ciphertext, refer to the smswithoutborders_lib_sig documentation.
+-------------------+--------------------+-------------------+-----------------+
| Ciphertext Length | Platform shortcode | Ciphertext | Device ID |
| (4 bytes) | (1 byte) | (Variable size) | (Variable size) |
+-------------------+--------------------+-------------------+-----------------+
platform_shortcode = b'g'
encrypted_content = b'...'
device_id = b'...'
payload = struct.pack("<i", len(encrypted_content)) + platform_shortcode + encrypted_content + device_id
encoded = base64.b64encode(payload).decode("utf-8")
print(encoded)- Format:
- 1 byte: Version Marker. See available versions.
- 2 bytes: Ciphertext Length.
- 1 byte: Device ID Length.
- 1 byte: Platform shortcode.
- Variable: Ciphertext. (encrypted Content Format V1).
- Variable: Device ID.
- 2 bytes: Language Code (ISO 639-1 format).
Note
For detailed instructions on using the Double Ratchet algorithm to create ciphertext, refer to the smswithoutborders_lib_sig documentation.
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
| Version Marker | Ciphertext Length | Device ID Length | Platform shortcode | Ciphertext | Device ID | Language Code |
| (1 byte) | (2 bytes) | (1 byte) | (1 byte) | (Variable size) | (Variable size) | (2 bytes) |
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
version_marker = b'\x01'
platform_shortcode = b'g'
language_code = b'en'
device_id = b'...'
encrypted_content = b'...'
payload = (
version_marker +
struct.pack("<H", len(encrypted_content)) +
bytes([len(device_id)]) +
platform_shortcode +
encrypted_content +
device_id +
language_code
)
encoded = base64.b64encode(payload).decode("utf-8")
print(encoded)- Format:
- 1 byte: Version Marker. See available versions.
- 2 bytes: Ciphertext Length.
- 1 byte: Device ID Length.
- 1 byte: Platform shortcode.
- Variable: Ciphertext. (encrypted Content Format V2).
- Variable: Device ID.
- 2 bytes: Language Code (ISO 639-1 format).
Note
For detailed instructions on using the Double Ratchet algorithm to create ciphertext, refer to the smswithoutborders_lib_sig documentation.
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
| Version Marker | Ciphertext Length | Device ID Length | Platform shortcode | Ciphertext | Device ID | Language Code |
| (1 byte) | (2 bytes) | (1 byte) | (1 byte) | (Variable size) | (Variable size) | (2 bytes) |
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
version_marker = b'\x02'
platform_shortcode = b'g'
language_code = b'en'
device_id = b'...'
encrypted_content = b'...'
payload = (
version_marker +
struct.pack("<H", len(encrypted_content)) +
bytes([len(device_id)]) +
platform_shortcode +
encrypted_content +
device_id +
language_code
)
encoded = base64.b64encode(payload).decode("utf-8")
print(encoded)- Format:
- 1 byte: Version Marker. See available versions.
- 2 bytes: Ciphertext Length.
- 1 byte: Device ID Length.
- 1 byte: Platform shortcode.
- Variable: Ciphertext. (encrypted Content Format V3).
- Variable: Device ID.
- 2 bytes: Language Code (ISO 639-1 format).
Note
For detailed instructions on using the Double Ratchet algorithm to create ciphertext, refer to the smswithoutborders_lib_sig documentation.
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
| Version Marker | Ciphertext Length | Device ID Length | Platform shortcode | Ciphertext | Device ID | Language Code |
| (1 byte) | (2 bytes) | (1 byte) | (1 byte) | (Variable size) | (Variable size) | (2 bytes) |
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
version_marker = b'\x03'
platform_shortcode = b'g'
language_code = b'en'
device_id = b'...'
encrypted_content = b'...'
payload = (
version_marker +
struct.pack("<H", len(encrypted_content)) +
bytes([len(device_id)]) +
platform_shortcode +
encrypted_content +
device_id +
language_code
)
encoded = base64.b64encode(payload).decode("utf-8")
print(encoded)- Format:
- 1 byte: Version Marker. See available versions.
- 2 bytes: Ciphertext Length.
- 1 byte: Device ID Length.
- 1 byte: Platform shortcode.
- Variable: Ciphertext. (encrypted Content Format V4).
- Variable: Device ID.
- 2 bytes: Language Code (ISO 639-1 format).
Note
For detailed instructions on using the Double Ratchet algorithm to create ciphertext, refer to the smswithoutborders_lib_sig documentation.
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
| Version Marker | Ciphertext Length | Device ID Length | Platform shortcode | Ciphertext | Device ID | Language Code |
| (1 byte) | (2 bytes) | (1 byte) | (1 byte) | (Variable size) | (Variable size) | (2 bytes) |
+----------------+-------------------+------------------+--------------------+-----------------+-----------------+---------------+
version_marker = b'\x04'
platform_shortcode = b'g'
language_code = b'en'
device_id = b'...'
encrypted_content = b'...'
payload = (
version_marker +
struct.pack("<H", len(encrypted_content)) +
bytes([len(device_id)]) +
platform_shortcode +
encrypted_content +
device_id +
language_code
)
encoded = base64.b64encode(payload).decode("utf-8")
print(encoded)