-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Replace in-house MD5 with OpenSSL #8272
Conversation
Pros: * ~4x speed up for MD5 hashes * ~800 less lines of code * Marginally smaller build sizes when using shared libs Cons: * Less control over implementation Benchmarks: Specs: Ubuntu 20.04 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz 31 GB RAM Hashing 1M strings 1000 characters long: Hashing using OpenSSL Implementation: 2651850801 ns Hashing using EPEE Implementation: 11596632481 ns Speedup: 4.37x Hashing 1M strings 100 characters long: Hashing using OpenSSL Implementation: 550373610 ns Hashing using EPEE Implementation: 2146028452 ns Speedup: 3.90x Conclusions: This could help boost wallet sync times where many RPC requests are made and authenticated over a short period of time.
Here is my benchmark code. To compile you need the following files:
I compiled with: |
Introducing this kind of dependency is a bit dicy, since MD5 support is optional in OpenSSL, and since MD5 has been deprecated in favor of SHA for a few years already, it's not uncommon for sites to omit it from their OpenSSL builds. Authentication traffic shouldn't be a large percentage of a wallet RPC session, so how much does this really save in practice? |
Not trying to be contrarian, but do you have any examples of builds of OpenSSL for platforms we support which omit MD5?
For this reason, shouldn't we be moving away from MD5 digest authentication anyways? There are a ton of more secure authentication protocols with nearly as much, if not more, support than MD5 Digest Authentication. I'm hoping that this is not permanent, it would make happier the quicker we ditch MD5 authentication, or at least require digest authentication to happen over SSL.
I haven't bench-marked that yet, but it's probably not too much. What do you think would be the most realistic way to stress test this? |
No, because as I said it's about sites, not platforms.
Run a private node, sync'd but disconnected from mainnet, and aim a wallet at it. If you use monero-wallet-rpc you ought to be able to automate the entire sequence to eliminate run variations. |
Closing this because MD5 is deprecated since OpenSSL 3.0, and like @hyc said, some people don't build their sites with MD5. |
Pros:
Cons:
Benchmarks:
Specs:
Hashing 1M strings 1000 characters long:
Hashing 1M strings 100 characters long:
Conclusions:
This could help boost wallet sync times where many RPC requests are made and authenticated over a short period of time.