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

md5_update behaves differently from other implementations. #15

Open
Gemini2015 opened this issue Jun 28, 2023 · 3 comments
Open

md5_update behaves differently from other implementations. #15

Gemini2015 opened this issue Jun 28, 2023 · 3 comments

Comments

@Gemini2015
Copy link
Contributor

md5_init(m);  
md5_update(m, "hello", strlen("hello"));  
md5_update(m, "world", strlen("world"));  
md5_finish(m, hash);  

hash: a48b171ee450c14dab8e7162cdce3f8d

md5_init(m);  
md5_update(m, "helloworld", strlen("helloworld"));  
md5_finish(m, hash);  

hash: fc5e038d38a57032085441e7fe7010b0

In Python or other C implementations, eg RFC 1321

hash_md5 = hashlib.md5()
hash_md5.update("hello")
hash_md5.update("world")
print(hash_md5.hexdigest())

hash: fc5e038d38a57032085441e7fe7010b0

hash_md5 = hashlib.md5()
hash_md5.update("helloworld")
print(hash_md5.hexdigest())

hash: fc5e038d38a57032085441e7fe7010b0

@niu2x
Copy link

niu2x commented Jul 12, 2024

i find the same bug., after debug several hours, very sadly

@Gemini2015
Copy link
Contributor Author

Gemini2015 commented Jul 12, 2024

i find the same bug., after debug several hours, very sadly

take a look at my fork, I fixed the bug, and It works welll.
https://github.com/Gemini2015/md5

@niu2x
Copy link

niu2x commented Jul 15, 2024

i find the same bug., after debug several hours, very sadly

take a look at my fork, I fixed the bug, and It works welll. https://github.com/Gemini2015/md5

good news . i didn't got your reply that day. i had enjoy openssl for this job.

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

No branches or pull requests

2 participants