pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.05k stars 231 forks source link

n00b: Loading a ed25519 key pair from base64 string #771

Closed FrankC01 closed 1 year ago

FrankC01 commented 1 year ago

Beginner:

Where can I create a ed25519 keypair (public key and private key) from a base64 string or it's decoded bytes?

reaperhulk commented 1 year ago

In this project you'll want to look at https://pynacl.readthedocs.io/en/latest/signing/#nacl.signing.SigningKey

FrankC01 commented 1 year ago

That expects 32 bytes, however the keypair is stored, for example: AKky78X+ERAnhbshgRVyrC0yfKwLYh6eh0mGS51A893KRWO62jCwbiXK8fTEmp6fJv0uz/1cKhRhJYIbYzRslTw=

reaperhulk commented 1 year ago

That's likely the 64 byte form, which pynacl doesn't directly support loading at this time (see: https://github.com/pyca/pynacl/pull/648)

FrankC01 commented 1 year ago

Thanks, I'm loading the Signing key just fine now.