The hardship is about getting it right since there is no standard for it and generally speaking inventing your own cryptography algorithm is not a good idea. I basically got the inspiration from BIP38[1] but instead of encoding the result using base58 I encode it like BIP39 to get words. The salt would add an extra word (128-bit entropy and a 32-bit salt to get 15 words) which could be increased in size to get 24.
[1]
https://github.com/bitcoin/bips/blob/master/bip-0038.mediawikiAre you encrypting a seed phrase with this algorithm and not just single private keys? Why not just follow it pedantically instead of modifying some parts like encoding? What if, several years from now, you forget what encoding you used when constructing your encrypted words? Maybe I am wrong, let alone I am not a security or cryptography expert, but I see many shortcomings in this approach.
You're right it implies to take care of your script or at least to be able to write it back again, even in several years from now, if you lose it.
So it's maybe safer to use
Bitcoin eXplorer and "your hands" instead.
As it is explained
here in the BX manual, you can encrypt a fresh generated entropy, or your own 256bits one, with the BIP38 encryption algorithm by using this command :
$ bx seed -b 256|bx ec-to-ek "my passphrase"
> 6PYN8wh8nNr18UvTf78s95cwNAgdd3zBsiB1b1H3vdn7A5SHmUb7XnHjqdSo now, you need to transform this string into a phrase with BIP39 words, you can do that this way :
First, thanks to
bx base58check-decode you can get the hexadecimal value of this string.
Now you will "just" need to convert this hexadecimal number into a binary one, and with your hands, to
split it into groups of 11 bits, each encoding a number from 0-2047, serving as an index into a wordlist as
BIP39 does and to find the word corresponding to the index(+1) into the
BIP39 dictionary of the language of your choice.
For decyphering your seed you'll consecutively take the index(-1) from the dictionary of each word of your phrase, convert each decimal index into its 11bits binary value (with enough 0 for padding) , group de 11bits words into a whole binary number that will be converted into its hexadecimal value, apply
bx base58check-encode to this value and finally decrypt it with your passphrase thanks to
bx ek-to-ec "my passphrase".
From the entropy, you just need to use
bx mnemonic-new to get the bip39 mnemonic seed.