4.1 Binary Format

A SID (Security Identifier) is a variable-length binary value that uniquely identifies a principal — a user, group, service, machine, or well-known entity. SIDs are the fundamental identity primitive of the Peios security model: they appear in tokens as identity, in security descriptors as access rules, and as references throughout the system.

A SID is encoded as a contiguous binary structure with the following layout:

OffsetSizeFieldDescription
01RevisionMUST be 1.
11SubAuthorityCountNumber of sub-authorities. MUST be between 0 and 15 inclusive.
26IdentifierAuthorityA 6-byte big-endian value identifying the authority that issued the SID.
84 × SubAuthorityCountSubAuthority[]Array of 32-bit unsigned integers in little-endian byte order.

The total size of a SID in bytes is 8 + (4 × SubAuthorityCount). The minimum size is 8 bytes (zero sub-authorities). The maximum size is 68 bytes (15 sub-authorities).

The last sub-authority in a SID is the Relative Identifier (RID) — the portion that distinguishes individual principals within a domain.

Edit this page