Recovery data lets a damaged file be repaired without any other copy: a fixed percentage of error-correction blocks is stored next to the original bytes. It is optional and comes in two variants that share one container format:
WIREHAIR_V2_PROFILE_CERTIFIED_2026_07 (profile id 0x4B295BBB47F4F9C9); all implementations produce identical recovery blocks.R = ceil(level% × K) + 2
offset size field
0 8 magic "PFTEREC1"
8 1 container version = 1
9 1 flags: 1 = embedded, 2 = external
10 1 level in percent (1-50)
11 1 reserved (0)
12 4 nominal block size in bytes
16 8 nominal segment size in bytes
24 8 Wirehair profile id = 0x4B295BBB47F4F9C9
32 16 name hash: first 16 bytes of SHA-256(UTF-8 file name)
(external files; all zero when embedded)
48 12 reserved (0)
60 4 CRC32 of bytes 0-59
RECOVERY BLOCKS - immediately after HEAD: the R0 recovery blocks of segment 0, then those of segment 1, and so on; each block is block size bytes of its segment.offset size field 0 8 offset of the segment's first byte within the protected region 8 4 R - number of recovery blocks 12 32 WHV2 descriptor (see below; carries the segment length and block size) 44 4 CRC32 of bytes 0-43INDEX - for each segment in order: K CRC32 values of the source blocks (0 ... K-1), then R CRC32 values of the recovery blocks; 4 bytes each. A source block's CRC covers its actual length (the last block may be short).
offset size field 0 8 offset of SEGMENT TABLE (from the container start) 8 8 offset of INDEX 16 8 container length (HEAD ... TRAIL, inclusive) 24 8 protected region length 32 4 segment count 36 4 flags (same as HEAD) 40 32 SHA-256 over HEAD + SEGMENT TABLE + INDEX 72 4 CRC32 of bytes 0-71 76 4 reserved (0) 80 8 magic "PFTEREC1"WHV2 descriptor (32 bytes) - the canonical Wirehair V2 message descriptor; a decoder is created from it alone:
offset size field 0 4 magic "WHV2" 4 2 encoding version = 1 6 2 descriptor size = 32 8 8 profile id = 0x4B295BBB47F4F9C9 16 8 message size = segment length in bytes 24 4 block size in bytes 28 1 seed attempt (0-255, chosen by the encoder) 29 3 reserved (0)
pec) - the standalone command-line tool: pec create, verify, repair, and
info for any file, including repairing an .enc archive's bytes without
its password.enc --recovery, rec-create, rec-verify, rec-repair)