]> ruderich.org/simon Gitweb - sss-vault/sss-vault.git/blob - README.adoc
c5759459c167edfca7091cfbd71ebd6e6e05e7ce
[sss-vault/sss-vault.git] / README.adoc
1 = README
2
3 :vault: https://github.com/hashicorp/vault
4 :0c6c13dd38: https://github.com/hashicorp/vault/commit/0c6c13dd38b9f921009b177797016dfc08dbc211
5
6 sss-vault is a CLI tool in Go that implements Shamir's Secret Sharing (SSS).
7 The actual implementation is copied from the shamir/ directory of
8 {vault}[HashiCorp's Vault].
9
10 The code in shamir/ is taken from {0c6c13dd38}[0c6c13dd38 (license: update
11 headers to IBM Corp. (#10229) (#10233), 2025-10-21)].
12
13 The static/ directory contains static binaries for Linux/amd64 and
14 Windows/amd64 in case no Go compiler is available.
15
16
17 == Limitations
18
19 SSS doesn't protect against (malicious) modifications of the parts. This makes
20 it possible for `combine` to seemingly succeed but not recover the actual
21 secret. This can also happen if fewer parts than the threshold are provided.
22 If this is an issue, add a cryptographic hash to the secret before splitting.
23 When the secret is used to decrypt authenticated data, any modifications are
24 detected and the hash is not necessary.
25
26 Make sure the secret is not stored in the shell history or anywhere similar,
27 such as terminal scrollback.
28
29
30 == Build
31
32 Needs Go to build, no external dependencies
33
34     $ go build
35
36
37 == Usage
38
39 ....
40 $ ./sss-vault split 5 3
41 Waiting for secret on stdin until EOF
42 Test
43 Message
44 !
45 <Ctrl-D>
46
47 Generated 5 parts with threshold 3
48
49 part 1:
50 YKJz2uuG6/n80bzKjm5Yjw==
51
52 part 2:
53 Es+deRZMztqSCClXozmfiw==
54
55 part 3:
56 B8z9cZOdVlMF/404WONuPQ==
57
58 part 4:
59 lnqwvWBJRAcRvPj3WwW6Gw==
60
61 part 5:
62 6jHfMI3pqqj6MC7SJb9iBg==
63 ....
64
65 ....
66 $ ./sss-vault combine
67 Waiting for parts on stdin until EOF (one per line)
68 6jHfMI3pqqj6MC7SJb9iBg==
69 YKJz2uuG6/n80bzKjm5Yjw==
70 B8z9cZOdVlMF/404WONuPQ==
71 <Ctrl-D>
72
73 Recovered secret:
74 Test
75 Message
76 !
77 ....
78
79 Terminal injection is avoided by escaping if necessary:
80
81 ....
82 $ ./sss-vault combine
83 [...]
84 Recovered secret (escaped):
85 "\x1b[31mterminal injection\x1b[0m"
86 ....
87
88
89 == License
90
91 The CLI is licensed under GPL-3.0-or-later and the SSS code from Vault under
92 MPL-2.0.