|0.7.0||Dec 17, 2021|
|0.6.4||Dec 14, 2021|
|0.6.2||Nov 30, 2021|
|0.6.0||Oct 29, 2021|
#514 in Embedded development
22 downloads per month
harpo is a tool and library that provides the following functionality:
- It can generate a seed phrase.
- It can validate a given seed phrase.
- Given a valid seed phrase, it can generate any number of secret-shared seed phrases.
- Given sufficiently many generated seed phrases, it can reconstruct the original seed phrase.
harpo crate gets its name from
Harpocrates, the ancient god of
silence, secrecy, and confidentiality.
harpo is reasonably well tested, use it at your own risk.
Make sure that Rust is installed.
After cloning the repository and changing the directory to
harpo, run the
cargo build --release
The binary can then be found under
running the command without the
Generation of a Seed Phrase
A seed phrase can be generated by running the following command:
harpo generate --length [L]
[L] must be either 12, 15, 18, 21, or 24.
The generated seed phrase is written to standard output.
Validation of a Seed Phrase
A seed phrase can be validated, i.e. checked for BIP-0039 compliance, by running the following command:
harpo validate (--file [F]))
The input is provided in one of two ways:
- By default, the seed phrase is entered on the command line.
- When using the
-f) option, the space-delimited seed phrase is read from the file at path
For example, the content of the file or input provided interactively may be:
cat swing flag economy stadium alone churn speed unique patch report train
Creation of Secret-Shared Seed Phrases
In order to create secret-shared seed phrases, run the following command:
harpo create --num-shares [N] --threshold [T] (--file [F])
The input is again provided in one of two ways, on the command line or
-f) option, in which case the space-delimited seed phrase
is read from the file at path
Note that the input seed phrase must pass validation, otherwise the execution will terminate with an error message.
Apart from specifying the input source, two other parameters are required:
[N]: The desired number
[N]of secret-shared seed phrases must be provided. Note that the number of shares can be at most 16 unless the option
--no-embeddingis used (see Additional Parameters).
[T]: The desired threshold
[T], i.e., the minimum number of secret-shared seed phrases required to reconstruct the original seed phrase, must be provided. The threshold must not exceed the number of shares.
The created seed phrases are written to standard output.
Reconstruction of a Secret-Shared Seed Phrase
In order to reconstruct the original seed phrase, run the following command:
harpo reconstruct (--file [F] | --interactive)
Again, the input is provided in one of two ways:
- By default, the seed phrases are entered on the command line, one after the other.
- When using the
-f) option, the space-delimited seed phrases are read from the file at path
[F], one seed phrase per line.
The reconstructed seed phrase is written to standard output.
If at least
[T] secret-shared seed phrases are provided, the output will
match the original seed phrase. Otherwise, the output is indistinguishable
from a random seed phrase.
The following additional parameters can be specified (before entering the subcommand):
-v): Add this flag in order to activate verbose output.
[W]: A different word list (other than the standard English word list) can be provided. It has to be a list of 2048 distinct words, with one word per line.
There is one optional parameter for the
-N): By default, the secret-shared seed phrases are not BIP-0039 compliant because they encode an index that is required for the reconstruction. In order to obtain BIP-0039 compliant seed phrases, the embedding can be turned off using this flag. In this case, the indices must be provided explicitly when using the
reconstructcommand. The format is
[INDEX]: [SEED PHRASE].
All available parameters can be printed using the
-h) flag for