bitcoin-dev

Penlock, a paper-computer for secret-splitting BIP39 seed phrases

Penlock, a paper-computer for secret-splitting BIP39 seed phrases

Original Postby Rama Gan

Posted on: May 14, 2024 12:43 UTC

Penlock, a cryptographic tool, employs a novel approach to secret splitting, utilizing a composite algorithm that differs based on the number of shares involved.

For splits involving only two shares out of a possible many (2-of-M), Penlock adopts a paper-friendly algorithm distinct from Shamir Secret Sharing, which is used for scenarios where more than two shares are required (K>2)-of-M. Both methods operate within the finite field GF(29), leveraging arithmetic modulo 29, which facilitates certain optimizations in paper-based implementations not feasible with binary fields (GF(2^N)).

The character set designed for use with Penlock includes the 26 letters of the Latin alphabet along with three additional symbols: '-', '=', and '+'. These characters are mapped to integers [0-28], enabling their direct involvement in the cryptographic processes. This mapping is crucial for the 2-of-M splitting algorithm, where secrets are encoded as differences between consecutive shares. To illustrate, splitting a character into three shares involves selecting a random character for the first share, then deriving subsequent shares by subtracting the secret value from the preceding share. The original secret can be retrieved by calculating the difference between any two shares and dividing by their positional distance, showcasing a variation of the Shamir Secret Sharing principle but tailored for Penlock's specific methodology.

Moreover, Penlock incorporates a simple yet effective checksum mechanism to ensure integrity and error detection within the data. By calculating the differences between each pair of consecutive characters, this checksum aids in identifying and locating errors, albeit without the capacity to correct missing data. This mechanism complements the redundancy inherent in secret splitting, where the loss or damage of one share can be compensated for by the remaining shares.

For practical implementation, Penlock offers tools such as a printable wheel available at beta.penlock.io/2ofm-wheel.html that facilitates the arithmetic operations needed for both 2-of-M splitting and checksum generation. This wheel, featuring outer rings for addition and subtraction alongside a spiral for division, exemplifies Penlock's commitment to accessibility and usability in cryptographic practices. Additional guidance, including a step-by-step tutorial for generating checksums using the wheel, can be found at beta.penlock.io/2of3-guide.html, further supporting users in securely managing and splitting secrets.