Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insecure use of ed25519 #55

Open
py0xc3 opened this issue Apr 24, 2020 · 1 comment
Open

Insecure use of ed25519 #55

py0xc3 opened this issue Apr 24, 2020 · 1 comment

Comments

@py0xc3
Copy link

py0xc3 commented Apr 24, 2020

Bernstein's python3 reference implementation of ed25519 is not appropriate for production purposes as it makes the python interpreter run functions for which that interpreter is not (cryptographically) designed, creating realistic attack scenarios in many environments.

Your optimization remains incorporating this weakness (line 18-33?).

Still, iroha-python uses your optimization for such purposes: it generates signatures and public keys from secret keys using ./ed25519.py.

Yet, the repository does not make aware of not being eligible for production purposes. Also, https://iroha.readthedocs.io/ suggests using iroha-python for production use.

I suggest to use cryptography with ed25519 / docs which is well maintained and suited for production use. Will have a better performance, too.

py0xc3 added a commit to py0xc3/iroha-python that referenced this issue May 3, 2020
I removed the unsafe ed25519 implementation from critical functions: it it still in use when only public information is involved (e.g. verification) but this is not a security problem but it is still very slow. But PyCA's cryptography is used when a private key gets involved. https://github.com/pyca/cryptography is well maintained. So, critical security issues are solved. Still, some things remain to be done: the unsafe ed25519 (see hyperledger-iroha#55) implementation should be completely removed to fully depend on cryptography from PyCA. The latter is faster and remains maintained if imported. The unsafe Ed25519 is also from PyCA (which marked it to be not safe and for testing use only) but was copied to the iroha-python repo, assuming it to be no longer maintained in there. Also, I suggest to remove Ed25519-related functions from IrohaCrypto class in order to use the cryptography module's classes directly. That's faster and easier to maintain on the long term, avoiding many unnecessary functions, serializations, ... in between.
@py0xc3 py0xc3 mentioned this issue May 3, 2020
@py0xc3
Copy link
Author

py0xc3 commented May 3, 2020

Security-critical issues solved in #58 - still, further testing of the pull request suggested!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants