This is an implementation of a Cipher Seed based on the aezeed encoding scheme:
https://github.com/lightningnetwork/lnd/tree/master/aezeed
The goal of the scheme is produce a wallet seed that is versioned, contains the birthday of the wallet,
starting entropy of the wallet to seed key generation, can be enciphered with a passphrase and has a checksum.
The aezeed scheme uses a new AEZ AEAD scheme which allows for enciphering arbitrary length texts and choosing
custom MAC sizes. AEZ is unfortunately not available in the RustCrypto implementations yet so we use a similar
AEAD scheme using the primitives available in RustCrypto.
Our scheme must be able to be represented with the 24 word seed phrase using the BIP-39 word lists. The word
lists contain 2048 words which are 11 bits of information giving us a total of 33 bytes to work with for the
final encoding.
In our scheme we will have the following data:
version 1 byte
birthday 2 bytes Days since fixed genesis point
entropy 16 bytes
MAC 5 bytes Hash(birthday||entropy||version||salt||passphrase)
salt 5 bytes
checksum 4 bytes CRC32