CLI
The CLI binary is safeparts. It reads from stdin by default and writes to stdout unless you pass -o.
Split a secret from stdin into 3 shares, requiring any 2 to recover:
echo -n "my secret" | safeparts split -k 2 -n 3 -e base64Write shares to a file:
echo -n "my secret" | safeparts split -k 2 -n 3 -e base64 -o shares.txtCombine
Section titled “Combine”Combine from stdin (any k shares):
printf "%s\n%s\n" "<share1>" "<share2>" | safeparts combineWrite the recovered secret to a file:
printf "%s\n%s\n" "<share1>" "<share2>" | safeparts combine -o secret.binPassphrases
Section titled “Passphrases”Split with a passphrase:
echo -n "my secret" | safeparts split -k 2 -n 3 -e base64 -P passphrase.txtCombine with a passphrase:
printf "%s\n%s\n" "<share1>" "<share2>" | safeparts combine -P passphrase.txtPractical workflow
Section titled “Practical workflow”- Do a practice run with a synthetic secret.
- Split the real secret.
- Store shares in separate places.
- Immediately test recovery with k shares.
- Delete the original secret from temporary locations.
Troubleshooting
Section titled “Troubleshooting”- no shares provided: input was empty or only whitespace.
- could not detect share encoding: pass —encoding explicitly.
- combine failed: shares are from different sets, corrupted, or the passphrase is wrong.