python-ed25519 icon indicating copy to clipboard operation
python-ed25519 copied to clipboard

Unable to install

Open davejakenic opened this issue 2 years ago • 2 comments

Hello,

I search an efficient non-deterministic signature algorithm in python.

I found the following example for using ed25519, which reads VERY intriguing:

import ed25519

privKey, pubKey = ed25519.create_keypair()
print("Private key (32 bytes):", privKey.to_ascii(encoding='hex'))
print("Public key (32 bytes): ", pubKey.to_ascii(encoding='hex'))

msg = b'Message for Ed25519 signing'
signature = privKey.sign(msg, encoding='hex')
print("Signature (64 bytes):", signature)

try:
    pubKey.verify(signature, msg, encoding='hex')
    print("The signature is valid.")
except:
    print("Invalid signature!")

credit: https://cryptobook.nakov.com/digital-signatures/eddsa-sign-verify-examples

I would like to use this, so I tried pip install ed25519, which yields the following error message:

$ pip install ed25519 Collecting ed25519 Using cached ed25519-1.5.tar.gz (868 kB) Preparing metadata (setup.py) ... done Using legacy 'setup.py install' for ed25519, since package 'wheel' is not installed. Installing collected packages: ed25519 Running setup.py install for ed25519 ... error error: subprocess-exited-with-error

× Running setup.py install for ed25519 did not run successfully. │ exit code: 1 ╰─> [15 lines of output] running install running build running build_py creating build creating build\lib.win-amd64-3.10 creating build\lib.win-amd64-3.10\ed25519 copying src\ed25519\keys.py -> build\lib.win-amd64-3.10\ed25519 copying src\ed25519\test_ed25519.py -> build\lib.win-amd64-3.10\ed25519 copying src\ed25519_version.py -> build\lib.win-amd64-3.10\ed25519 copying src\ed25519_init_.py -> build\lib.win-amd64-3.10\ed25519 UPDATING build\lib.win-amd64-3.10\ed25519/_version.py set build\lib.win-amd64-3.10\ed25519/_version.py to '1.5' running build_ext building 'ed25519._ed25519' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> ed25519

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.


So I clicked the download on the link, which to my greatest regret installed visual studio on my computer. Afterwards, trying the pip install again, yields just the same exact error message from above.

I must add that I do not quite understand why the algorithm could not have been implemented in pure python. I have a minimum working example of brainpool curve Diffie-Hellman that worked just smoothly.

Is there another curve with a more reliably to install library. My area of application is democracy software. It would be to utmost concern if a user is unable to install the software because some package instability or dependency or unreliability.

What do you advise so that I can make a code, close to the above, work on a real-world PC ?

davejakenic avatar Jul 24 '22 15:07 davejakenic

same here

AMac2022 avatar Nov 17 '22 16:11 AMac2022

I am struggling with this library. Can you use this method, .to_ascii(encoding='hex') ?

yugocabrio avatar Jan 04 '23 01:01 yugocabrio