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

Improve from digest comment #711

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

Kixunil
Copy link
Collaborator

@Kixunil Kixunil commented Jul 24, 2024

Minor improvement on top of #712

@apoelstra
Copy link
Member

Agreed we should say "cryptographically broken" rather than "unsafe". Saying there's a "trivial exploit" is a bit misleading. The issue is that you can "forge a signature" on a 32-byte value that you obtain by just running the signature algorithm and backsolving for what the hash has to be.

If you have an actual hash then you can't do this obviously, and you also can't do it if you have specific target text in mind like CSW is not Satoshi.

@Kixunil
Copy link
Collaborator Author

Kixunil commented Jul 25, 2024

The issue is that you can "forge a signature" on a 32-byte value that you obtain by just running the signature algorithm and backsolving for what the hash has to be.

That's trivial, isn't it?

you also can't do it if you have specific target text in mind like CSW is not Satoshi.

Yes but "hey, I own this key, as a proof, here's a signature of some random gibberish" was proven to be good enough to fool journalists. (Even technical! - the claim that CSW proved identity by signature was posted by a czech technical website without verification and only later it was updated to say it's not a valid signature.) So maybe it should say "trivial to exploit in some scenarios".

@apoelstra
Copy link
Member

That's trivial, isn't it?

It's trivial but it's not obviously an "attack". Is confusing journalists an attack? I guess it is, but making this have real-world consequences is far from trivial and seems to require running a multi-year con job.

Maybe we could say it "has been trivially used in the past to execute attacks". We could even link to the CSW stunt in the docs.

@Kixunil
Copy link
Collaborator Author

Kixunil commented Jul 25, 2024

Maybe we could say it "has been trivially used in the past to execute attacks".

Sounds good.

@Kixunil Kixunil force-pushed the improve-from_digest-comment branch 2 times, most recently from 6b4ea98 to baf5708 Compare July 27, 2024 14:43
@apoelstra
Copy link
Member

New text looks good to me.

The example claimed it'd be unsafe, which is a specific Rust term and
thus confusing. It'd just be cryptographically broken. Also the example
passes in a constant which looks ridiculously unrealistic.

Fix these by
* changing the comment to say cryptographically broken
* making the example pass the input through invisible fake hash function
@Kixunil Kixunil force-pushed the improve-from_digest-comment branch from baf5708 to 72e09c1 Compare July 28, 2024 18:36
@Kixunil Kixunil marked this pull request as ready for review July 28, 2024 18:36
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 72e09c1

@apoelstra apoelstra merged commit 2753b9e into rust-bitcoin:master Jul 29, 2024
21 checks passed
@Kixunil Kixunil deleted the improve-from_digest-comment branch July 29, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants