Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements a key derivation scheme and a fixed seed key generation #155

Merged
merged 4 commits into from May 24, 2023

Conversation

commial
Copy link
Contributor

@commial commial commented Apr 24, 2023

Fix #154

This PR:

  • add a --seed option to mlar keygen to deterministically generate keypair
  • add a mlar keyderive to derive key along a hierarchical path, ie. to build key-tree
  • add their associated tests
  • document their internals in the README's FAQ

Notes on the implementation (the algorithm detail is in the PR):

  • the seed is a string used to seed the ChaCha-20 PRNG already used to generate keypairs. A SHA-512 is used to convert the input seed to the expected format. Only 32 bytes is needed, but using this scheme, extra bytes are provided for a potential future use
  • the derivation is made using HKDF with the same idea: the HKDF function is used to create a seed, feed in the ChaCha-20 to create a new keypair. The ChaCha-20 might not be useful here, but it adds a layer of irreversibility and simplifies the implementation

@commial commial added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 24, 2023
@commial commial added this to the mlar v1.3.0 milestone Apr 26, 2023
@commial commial merged commit 4476a1a into master May 24, 2023
22 checks passed
@commial commial deleted the key-derive branch May 24, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a seed / HKDF capabilities to mlar keygen
1 participant