tAdd "magic pattern" for header parsing with file(1) - cream - Stream encryption utility
(HTM) git clone git://git.z3bra.org/cream.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 691bd2ae3930f66cc344eab0a917f81af498b388
(DIR) parent 4c57dcc42af73cba15da06330ad73fcf54f65416
(HTM) Author: Willy Goiffon <contact@z3bra.org>
Date: Mon, 17 Oct 2022 18:40:05 +0200
Add "magic pattern" for header parsing with file(1)
Diffstat:
M README | 14 +++++++++++++-
A cream.magic | 10 ++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/README b/README
t@@ -25,7 +25,19 @@ Send an encrypted file over the network
# Receiver side, receive data on port 1337
nc -l 1337 | cream -d > file.jpg
-The format of the encrypted data is detailed in the cream(5) manual page.
+Format
+------
+
+For convenience, encryption parameters are included at the beginning of
+the stream. The header is 48 bytes long, and can be parsed using the
+file(1) command:
+
+ % file -m cream.magic data.enc
+ data.enc: CREAM encrypted data, version 1,
+ xchachapoly1305: k=32 iv=16 bs=8192,
+ argon2id: m=65536 t=2 p=1
+
+The complete format is detailed in cream(5) manual page.
Installation
-----
(DIR) diff --git a/cream.magic b/cream.magic
t@@ -0,0 +1,10 @@
+0 string CREAM\1 CREAM encrypted data,
+>6 beshort x version %d,
+>8 belong x xchachapoly1305:
+>8 belong x k=%d
+>12 belong x iv=%d
+>16 belong x bs=%d,
+>24 belong x argon2id:
+>24 belong x m=%d
+>20 belong x t=%d
+>28 belong x p=%d