Horcrux (jesseduffield)

From Just Solve the File Format Problem
Jump to: navigation, search
File Format
Name Horcrux (jesseduffield)
Ontology
Extension(s) .horcrux

A Horcrux is a concept from the Harry Potter universe whereby a dark wizard/witch's soul is split into parts to make it more difficult to kill him/her. This format, from GitHub user jesseduffield, is one of two known implementations of a concept of file encryption and splitting inspired by this. (The other is Horcrux (kndyry).)

When you create a set of horcruxes from a file (using a command-line-based program that is distributed as open-source and has compiled executables for several systems), you can choose how many horcruxes to create and how many of them need to be gathered in order to reconstitute the file. For instance, you may have 5 horcruxes of which 3 are needed, so that any three of the horcruxes can be used to regenerate the original file. No additional decryption key is needed, since the key itself is rebuilt from the file headers. Shamir's Secret Sharing is used to divide the key.

Each of the horcrux files is (usually) the same length as the original file. (This may not be the case if the original file was very small.)

Identification

Files start with this ASCII sequence: (with lines separated by linefeeds and the # character on the first character of each line)

# THIS FILE IS A HORCRUX.
# IT IS ONE OF 5 HORCRUXES THAT EACH CONTAIN PART OF AN ORIGINAL FILE.
# THIS IS HORCRUX NUMBER 1.
# IN ORDER TO RESURRECT THIS ORIGINAL FILE YOU MUST FIND THE OTHER 4 HORCRUX(ES) AND THEN BIND THEM USING THE PROGRAM FOUND AT THE FOLLOWING URL
# https://github.com/jesseduffield/horcrux

(where the numbers will vary depending on how the files were created)

This is followed by a -- HEADER -- and -- BODY -- section.

The header is in JSON format with this structure (as given in the Go language source code):

type HorcruxHeader struct {
OriginalFilename string `json:"originalFilename"`
Timestamp int64 `json:"timestamp"`
Index int `json:"index"`
Total int `json:"total"`
Threshold int `json:"threshold"`
KeyFragment []byte `json:"keyFragment"`
}

Sample files

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox