# Is it possible to run HD derivation with an encrypted master node or seed?

Given either a seed or the private part of a master node, that is encrypted using AES-256-CBC (or another secured symmetrical cypher) with key `K`, is it possible to run derivation such as described in BIP32 to obtain derived private keys also encrypted using the same algorithm and the same key `K`?

• Though EC-point operations exhibit homomorphic properties: (a+b)G = A+B, homomorphic encryption of a HD key pair and deriving its encrypted child is not possible from what I can think of: Such an encryption scheme would need both encrypted and unencrypted key pass through the HD child derivation step with their relationship intact. Given that the HD child derivation involves a one-way HMACSHA512 function, this seems very hard. – James C. Feb 5 at 15:31
• @JamesC. Shoot. If you can provide some relevant links and a more detailed explanation, feel free to turn your comment into an answer. – Kyll Feb 5 at 16:18
• look into bip38. this does what you want. i am not a cryptologist so can't explain how it does it but it does do it. – Abdussamad Feb 5 at 21:52

It seems like you are looking for an encryption scheme which allows operations to be performed on cipher text, which would result in the same as the same operations being applied to the unencrypted data.

Example: Homomorphic encryption which supports addition

• E(data0) + E(data1) = E(data0 + data1)
• k being the encryption key, and E(...) the encrypted cipher text.

In then case of HD keys, the desired encryption scheme would need to enable the following

• hd_child_derivation(E(m)) = E( hd_child_derivation(m) )
• hd_child_derivation() involving a HMACSHA512 function and EC-point operations

I am not sure which encryption schemes would fulfil the above requirements, but fully homomorphic encryption schemes seem to be possible: https://crypto.stanford.edu/craig/craig-thesis.pdf

• Thanks for the answer. I'll try to build something upon it and check if it's possible =) – Kyll Feb 6 at 18:06