dsprenkels / sss-cli

Command line program for secret-sharing strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding a line on share anatomy to share length FAQ topic

sunknudsen opened this issue · comments

$ echo "foo" | /home/pi/.cargo/bin/secret-share-split -n 5 -t 3
0178badbbb28a5a649fc61877913d95b46d588478c575a8c1c5d8b31b77a598a5fa28eaf0d082148a529f424b47038d51c4faa44c7
02ed450054d546a26353468e806b55a1d22854bc8e59cb72c34c4d35ae5dd51e1ca28eaf0d082148a529f424b47038d51c4faa44c7
0368ff23d52f87828358a81ff68053781b9b8e95788b2e445b0d6ff0c66ee386a2a28eaf0d082148a529f424b47038d51c4faa44c7
04d922dd2151fa45625a3e8f9da6feda4836cce785b1f597a1d9cc368fb275965ea28eaf0d082148a529f424b47038d51c4faa44c7
055c98fea0ab3b658251d01eeb4df803818516ce736310a13998eef3e781430ee0a28eaf0d082148a529f424b47038d51c4faa44c

I notice trailing a28eaf0d082148a529f424b47038d51c4faa44c7 is identical among shares.

$ echo "pdU3KQFgcOlgafG1pcRxMmCFWj2Tt474" | /home/pi/.cargo/bin/secret-share-split -n 5 -t 3
01d793e9104984849e02e8bef005ee134b81ff8bb5a2599862359d490dde962144b3bb2c626e0aab185bdc8bd4beb6a1553b8a97e30fd05482741290d826fe9ef718684340d73b3de8306c2699259bf4c189
02f4686914110e4cff5d01a02cd729cd2457fc0f9351ddcad71d730acac4faf611b3bb2c626e0aab185bdc8bd4beb6a1553b8a97e30fd05482741290d826fe9ef718684340d73b3de8306c2699259bf4c189
030f71b7f8cbdbdf7c0f5f2593cfd0c02d7138911e3c15fa48c84f043dc9145905b3bb2c626e0aab185bdc8bd4beb6a1553b8a97e30fd05482741290d826fe9ef718684340d73b3de8306c2699259bf4c189
045338429b387a2213d8ef0891571aaa459ae5d5ebe33864952a8082a3c9688a6db3bb2c626e0aab185bdc8bd4beb6a1553b8a97e30fd05482741290d826fe9ef718684340d73b3de8306c2699259bf4c189
05a8219c77e2afb1908ab18d2e4fe3a74cbc214b668ef0540affbc8c54c4862579b3bb2c626e0aab185bdc8bd4beb6a1553b8a97e30fd05482741290d826fe9ef718684340d73b3de8306c2699259bf4c189

I notice trailing b3bb2c626e0aab185bdc8bd4beb6a1553b8a97e30fd05482741290d826fe9ef718684340d73b3de8306c2699259bf4c189 is identical among shares.

I am very curious about anatomy of shares. @dsprenkels, perhaps you could add a line on the subject to share length FAQ topic.

I am guessing it has something to do with AEAD...

Indeed, the actual shared data is encrypted using an AEAD and put in every share. The format of the share is really:

  • 1 byte: X
  • 32 bytes: Y
  • the rest: the AEAD ciphertext (including MAC)

Note to self: This question has been asked earlier in #14, so we should indeed really add it to the README.