Skip to main content

Envelope Format

Version 0

Version10Version of the pigi file format. This defines the rest of the fields
Algorithm11A single-byte to signal which algorithms are used
File ID322The SHA256 of the original file
Length434The length of the Payload field (uint32 big endian)
IV1638The Initialization Vector
PayloadValue(Length)54The encrypted and compressed payload

The Pigi file format version 0 can be defined using the restructure Node.js library as follows:

import r from 'restructure';

export const PigiStruct = new r.VersionedStruct(r.uint8, {
0: {
algorithm: new r.Enum(r.uint8, Algorithms),
originalFileHash: new r.Buffer(32),
encryptedSize: r.uint32be,
iv: new r.Buffer(16),
encryptedData: new r.Buffer('encryptedSize'),