#bip-39 #phrase #sequence #vault #secret #generator #seed

app seedphraser

BIP39 secret phrase generator

4 releases (2 breaking)

0.3.0 Feb 3, 2025
0.2.1 Jan 16, 2025
0.2.0 Jan 16, 2025
0.1.0 Jan 16, 2025

#191 in Cryptography

Download history 321/week @ 2025-01-14 22/week @ 2025-01-21 38/week @ 2025-01-28 84/week @ 2025-02-04

465 downloads per month

MIT license

35KB
649 lines

seedphraser

Read and writes BIP39 seed phrases. This also supports an extended version on top of the 128-bit, 160-bit, 192-bit, 224-bit and 256-bit forms. There is also long sequence support.

Installing

$ cargo install seedphraser
$ seedphraser --help

Alternatively, you may download a release from the release tab on GitHub. For example on Linux,

$ wget https://github.com/DiscordJim/seedphraser/releases/download/release/x86_64-unknown-linux-gnu
$ mv x86_64-unknown-linux-gnu seedphraser && chmod +x seedphraser

Vault Mode

Vault mode allows you to create a print safe version. It works like this. Suppose we have a phrase food will struggle that hip coyote potato exit debate ski pluck glass. Then we go,

$ echo "food will struggle that hip coyote potato exit debate ski pluck glass" | seedphraser vault create -o vault.txt -k vault.key

This will create two files (yours may differ since the generated keys are random). For instance in this case vault.key looks like,

bridge wet either nuclear rib hunt paper trophy song mansion today axis shoulder fossil crane satisfy speak menu example pretty attract bullet echo fog

and vault.txt looks like,

VAULT
Algo: AES256GCM
Lang: ENG
Seed Algorithm: BIP39
Generated w/ seedphraser tool 0.2.1

Payload: cradle simple rabbit school rocket beauty make pizza blur desert tent obvious casual caught buyer park room custom sock mention hint whip firm dove

Nonce: tourist umbrella heavy parrot skin reform october mandate inside agree female trial

Key: _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____

The utility of this is that we can print this out, and then write the key down and then if the file is intercepted onto the way to the printer it is still safe. To decode,

$ export VAULT_KEY = "bridge wet either nuclear rib hunt paper trophy song mansion today axis shoulder fossil crane satisfy speak menu example pretty attract bullet echo fog"
$ export VAULT_NONCE = "tourist umbrella heavy parrot skin reform october mandate inside agree female trial"
$ export VAULT_PAYLOAD = "cradle simple rabbit school rocket beauty make pizza blur desert tent obvious casual caught buyer park room custom sock mention hint whip firm dove"
$ seedphraser vault decode -p $VAULT_PAYLOAD -k $VAULT_KEY -n $VAULT_NONCE -o txt
> food will struggle that hip coyote potato exit debate ski pluck glass

Long Sequences

A long sequence is a sequence that exceeds 256-bit. It will be padded with 256-bit chunks for simplicity. If here is an amount that is not divisible by 256-bits, then padding will be used and a @ <trim> will be appended onto the end which tells the program how many bytes to trim off the end. For instance consider,

moon topic gas diary boss siege among violin lumber expose trade obey @14

We first convert this into bytes and then can discard the last fourteen bytes.

This means that the tool can work with odd sequence lengths such as 2072.

Examples

Generate a new seed phrase of 256 bits and store it in a file named example.txt:

$ seedphraser generate -b 256 > example.txt

Read that file out and convert the output to base-64:

$ cat example.txt | seedphraser -i txt -o b64 > example.b64

Dependencies

~6–8MB
~155K SLoC