Help needed, issue
wojake opened this issue · 3 comments
Hey ECDSA team,
I have a problem, im trying to exchange the keys for "SigningKey, NIST521p, VerifyingKey" to another computer/code using sockets module.
I tried sending the other computer the key (hex) but it dint work out, need some help to make this work out. #
how did you encode the key to hex and how did you try to decode it from hex?
how did you encode the key to hex and how did you try to decode it from hex?
The probelm is not about the hex encode/decode, im sorry but whats the most effiecient and secure way to exchange keys with 1 machine to another using socket(SSL) module?
python-ecdsa doesn't support encrypting private keys (SigningKey), so you can't really do anything "secure" with them on python-ecdsa level; if you establish TLS connection to the other side with proper certificate verification and modern parameters, then sending them over it will be secure, but that's completely outside this library...
most efficient (smallest) is the raw encoding for private keys, and sending the public key as a compressed point. Note that you'll need to also send some ID of the used curve, if you don't hardcode use of a specific one.
that is, those two calls:
python-ecdsa/src/ecdsa/keys.py
Lines 544 to 563 in 106798c
python-ecdsa/src/ecdsa/keys.py
Lines 1080 to 1090 in 106798c
look for
from_string() methods to perform the inverse operation.