is it possible to generate set of child private keys from one parent private key, generated by ECC for example, securely? So that new private key (and derive public key) could be used for encryption or signing/verification?
The process of generation of a new private key could be relatively slow (up to a few seconds), so that even if attacker obtains some of the child private or derived public keys, he would not be able to derive parent private key - by lets say making some statistical analysis on them.
My intuitive take on this would be to basically encrypt the padded (deterministic)index of the child and then use some pwd hashing algorithm/technique like:
- Key Stretching (bcrypt, scrypt, ...)
- recursively calling HMAC multiple times
To obtain the child priv key. For the next child you should just increment the index. So in essence and without any other optimizations it could look like this:
function getChildPrivKey(index, parentPrivKey, parentHMACKey) {
encryptedPaddedIndex = aes.encrypt(index, parentPrivKey)
return recursivelyCallHMAC_X_Times(parentHMACKey, encryptedPaddedIndex, 'blake2b')
}
parentPrivateKey = ...
parentHMACKey = getRandomNumber()
firstChildIndex = 000....0 // 256x0
firstChildPrivateKey = getChildPrivKey(firstChildIndex, parentPrivateKey, firstChildIndex)
secondChildPrivateKey = getChildPrivKey(firstChildIndex+1 , parentPrivateKey, firstChildIndex)
// ...
My questions are:
- general: Is this a right direction?
- hmac: Would HMAC be considered convenient in this context over Key stretching with a salt (like in bcrypt or scrypt)?
- optimization: Would introducing many more recursive rounds of hashing make this better?
Thank you very much and I am sorry if this question is silly/trivial/mixing some concepts - I consider myself a relative newcomer to cryptography