warner / python-tweetnacl

Python bindings to the "TweetNaCl" cryptography library
Other
12 stars 5 forks source link

deterministic key-generation #1

Open warner opened 10 years ago

warner commented 10 years ago

In my python-ed25519 bindings I included functions to generate keys deterministically, which turn out to be pretty handy when doing system design (you can derive a bunch of signing keys from some common secret seed, then only store the seed). To do this, I modified the C code to add a function that takes a secret (signing) key and returns the corresponding public (verifying) key. While I was at it, I made it possible to store just the 32-byte secret part of the signing key, rather than requiring all signing keys to include a copy of the verifying key too (allow developers to make the time-vs-space decision themselves).

I'd like to bring these changes over to python-tweetnacl too, both for the Ed25519 signingkey->verifyingkey function, and the Curve25519 privatekey->publickey function.