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

What's a better error message in decapsulate_reencrypted than "generic umbral error"? #22

Open
jMyles opened this issue Jan 18, 2018 · 12 comments

Comments

@jMyles
Copy link
Contributor

jMyles commented Jan 18, 2018

I don't exactly understand what is being asserted here.

Perhaps, "This capsule doesn't appear to have been made for this public key" ?

jMyles added a commit to jMyles/pyUmbral that referenced this issue Jan 18, 2018
@jMyles
Copy link
Contributor Author

jMyles commented Jan 18, 2018

This error seems to be raised if not enough cFrags are present to open the Capsule.

However, currently the assertion requires original Alice components to check. @cygnusv: Is there a way to check without those?

@cygnusv
Copy link
Member

cygnusv commented Jan 19, 2018

That check is ensuring that the reconstructed capsule comes from the original capsule, so by definition, there is no way to check that without the original components.

There are many possible problems that may make this check to fail, but from the cryptographic point of view, we don't want to give detailed information of the error in order to avoid potential attacks. The reason is that there are many attacks out there exploiting the different possible error messages to infer secret information (e.g., private keys). An example (not applicable here), is padding oracle attacks

@cygnusv
Copy link
Member

cygnusv commented Jan 19, 2018

Having said that, this error message could be something like you said:
"This capsule doesn't appear to have been made for this public key"
or perhaps "This capsule doesn't appear to be openable with your private key"

@tuxxy
Copy link
Contributor

tuxxy commented Jan 19, 2018

I propose: "Failed to decrypt with the provided private key"

@jMyles
Copy link
Contributor Author

jMyles commented Jan 19, 2018

Poking around, I seem to be able to generate this error in two ways:

  1. Trying to decap with the wrong private key.
  2. Trying to decap without enough cFrags.

Is there a way to naively (ie, without injecting the value of m) distinguish between these problems? Worse to give a generic error message is to give an incorrect one.

@jMyles
Copy link
Contributor Author

jMyles commented Jan 19, 2018

There are many possible problems that may make this check to fail, but from the cryptographic point of view, we don't want to give detailed information of the error in order to avoid potential attacks. The reason is that there are many attacks out there exploiting the different possible error messages to infer secret information (e.g., private keys)

Well, if something is knowable in the scope of this function, then it is already in the purview of an attacker who has direct witness over its execution. Sure, we don't want to encourage users to spread detailed error information in a public way (as with any application), but I don't think there's any harm in this function failing in such a way that discriminates between the various possibilities, is there?

@cygnusv
Copy link
Member

cygnusv commented Jan 19, 2018

Is there a way to naively (ie, without injecting the value of m) distinguish between these problems?

I think there is not (and there shouldn't be).

Well, if something is knowable in the scope of this function, then it is already in the purview of an attacker who has direct witness over its execution.

Yes, that's true, but that's not the target type of adversary for this measure. We are dealing here with the ones that have black-box access (e.g., remote access).

@jMyles
Copy link
Contributor Author

jMyles commented Jan 19, 2018

Yes, that's true, but that's not the target type of adversary for this measure. We are dealing here with the ones that have black-box access (e.g., remote access).

Exactly, so there's no harm in the function raising different errors for these different conditions.

@KPrasch
Copy link
Member

KPrasch commented Feb 14, 2018

This now an exception class umbral.GenericUmbralError. Still could use a better message.

@tuxxy
Copy link
Contributor

tuxxy commented Feb 24, 2018

I think we can go ahead and close this now. @jMyles @KPrasch @cygnusv

@KPrasch
Copy link
Member

KPrasch commented Apr 4, 2018

@KPrasch
Copy link
Member

KPrasch commented Jul 3, 2018

Do we intend to leave the message blank here? https://github.com/nucypher/pyUmbral/blob/master/umbral/pre.py#L440

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

No branches or pull requests

4 participants