Obtain a printable signature string #279
Answered
by
tomato42
Robert-vonZira
asked this question in
Q&A
|
ecdsaPrivateKey.sign_deterministic(b"message") I want to get the signatures a string (to save it into txt file) For privatekeys there is ta similar function: ecdsaPrivateKey.to_string().hex()) How could the signature data be transformed into a printable (and therefore txt file - writeable) string format? Thank you in advance for your answer(s)! |
Answered by
tomato42
Dec 17, 2021
Replies: 1 comment 1 reply
|
If you use sigencode function that returns from ecdsa import SigningKey
sk = SigningKey.generate() # uses NIST192p
vk = sk.verifying_key
signature = sk.sign(b"message")
assert vk.verify(signature, b"message")
signature.hex()will return something like (the contents will vary, but that's the length you can expect for NIST192p) |
1 reply
Answer selected by
tomato42
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you use sigencode function that returns
bytes(), the calling.hex()on the returned object will give you a string:will return something like
(the contents will vary, but that's the length you can expect for NIST192p)