-
Notifications
You must be signed in to change notification settings - Fork 26
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
Adding the revealed messages to the chalenge to avoid forgery #74
Comments
No this is not correct. BBS+ is unforgeable like ECDSA. This includes in proofs. You have a bug in your math. If you compute it correctly you can’t forge proofs or signatures |
@mikelodder7 can you highlight the bug in the maths here? |
The problem is sending msg_adv and not m^_2. m^_2 = m~_2 +cm_2. msg_adv = m_2c' + m_2. If you calculate with that difference the equation does not balance. @BasileiosKal. ^^ |
It appears to work in my quick test. I think just adding the number of revealed messages to the challenge hash might be sufficient, unless there's a way to do the same thing in reverse to make that balance. |
So your saying I should have over 1/c* my first name as the revealed message? In practice will someone believe that? No. The procedure for revealed messages should include the mapping of how they got to the cryptographic value. |
For example, let's assume m_2 is my first name. The mapping is hash to Z_q*. If I received msg_adv, I would hash to Z_q* and check it. The hashing effectively destroys the 1/c computation and the proof fails. |
I'm not seeing how this is even working. Just tried in my rust code and it fails. |
It would probably not be useful for any hashed values, but it could work for numeric values since the prover can run the protocol many times until they get a |
I do also agree this is hard to take advantage in practice but we should be protected against it either way. A forgery is still dangerous IMO. If it's a name we talking about this may not be of use but what if it's a revocation ID and I'm able to present a different one?? The message mappings are not mandatory and IMO the proof should be safe without them. We could make hashing of the messages mandatory but I think there are simpler solutions.
Yeap that may be anotherore efficient solution |
Still not seeing how this attack even works. I just tried it and my proof fails. |
I added a reproduction here. (Edit: updated to add the unforged proof check.) |
@andrewwhitehead That example is not using an unsigned message. The point of this is that mh isn't even signed. Try it with another random message that's not in the signature. |
@mikelodder7 The point is that the proof verifies with the revealed message |
Actually, it's not sufficient to add the number of revealed messages, I believe the actual revealed messages have to be added to the hash to prevent substitution. |
I remember @christianpaquin mentioning on a WG call that UProve included a similar mechanism? |
Yes, in the U-Prove spec, the prover hashes (among other things) the disclosed attribute indices and their values (see |
If we take
So i don't see where I'm wrong to be honest, but i could be missing something. |
Right, I guess nothing stops the prover from passing the "wrong" number of messages from the start (i.e., 2 in the example above). Maybe, aside from the revealed messages, we should also pass the |
@BasileiosKal is this addressed via #95 or are there still updates we need to make to the proof challenge? |
The following is a method that could possibly allow the prover to reveal messages for which they don't have a signature, taking advantage of the Fiat–Shamir challenge not containing the revealed messages. Let the prover with a signature
(A, e, s)
on messagesmsg_1
,msg_2
andmsg_3
, creating an spk revealing onlymsg_1
. Going through the spkGen process the prover will calculateThe proof value will be,
From the verification process we know that if
T = P1 + H_1 * msg_1
thenLet the prover now calculate the following,
c’ = c ^ -1 mod q
msg_adv = m^_2 * c'
and instead of revealing spk, they send
spk2
,with revealed messages
msg_1
andmsg_adv
.The verifier receiving
spk2
andmsg_1
,msg_adv
will calculateC1_verifier
,C2_verifier
and check the pairing equality. Note that sinceAbar, A’, D, c, e^, r2^
remain the same betweenspk
andspk2
,C1_prover = C1_verifier
ande(A', PK) = e(Abar, P2)
. To calculateC2_verifier
the verifier will first calculateT2
as,From that the verifier will calculate,
The last equality follows from #EQ1. As a result, the verification will succeed for
msg_1
andmsg_adv
.Obviously, this should not be possible, since this proves knowledge of a signature that the prover doesn't have (which contains
msg_adv
). If I'm correct on the above, most likely the only issue is with the Fiat–Shamir heuristic. Note that if the protocol was interactive, that method will not work, since the prover would have to "commit" to the messages prior of getting the challengec
. Hence we should also pass the revealed messages to the hash of the challenge during spkGen and spkVerify, to "commit" them before the challenge is created.The text was updated successfully, but these errors were encountered: