1 2#------------------------------------------------------------------------------ 3# $File: syd,v 1.1 2025/09/11 01:49:40 christos Exp $ 4# syd: file(1) magic for syd(1) encrypted files 5# 6# From: Ali Polatel <alip@chesswob.org> 7# Documentation: https://man.exherbo.org/syd.7.html#Crypt_Sandboxing 8# No defined extension yet; files are recognized by magic header only. 9# 10# Layout: 11# 0..3 : "\x7fSYD" 12# 4 : version byte (current API: 3) 13# 5..36 : HMAC (32 bytes, SHA256) 14# 37..52 : IV (16 bytes) 15# 53.. : ciphertext (AES-256-CTR) 16#------------------------------------------------------------------------------ 17 18# Header and version 190 string \x7fSYD SYD encrypted file 20>4 ubyte x \b, version %u 21# Version 3: algorithm + HMAC/IV as hex blobs + ciphertext size 22>>4 ubyte =3 \b, AES-256-CTR; HMAC-SHA256: 23>>>5 belong x \b%08x 24>>>9 belong x \b%08x 25>>>13 belong x \b%08x 26>>>17 belong x \b%08x 27>>>21 belong x \b%08x 28>>>25 belong x \b%08x 29>>>29 belong x \b%08x 30>>>33 belong x \b%08x 31>>>37 belong x \b, IV:%08x 32>>>41 belong x \b%08x 33>>>45 belong x \b%08x 34>>>49 belong x \b%08x 35>>>-0 offset-53 x \b, ciphertext %llu bytes 36 37# End of syd 38