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

Check private key when decrypting from CLI #38

Open
mpnd opened this issue Jun 15, 2016 · 1 comment
Open

Check private key when decrypting from CLI #38

mpnd opened this issue Jun 15, 2016 · 1 comment

Comments

@mpnd
Copy link
Contributor

mpnd commented Jun 15, 2016

I notice an interesting behaviour when testing CLI. When trying to decrypt an encrypted number using an "incorrect" private key (eg, one that has different keysize to a public key used during encryption) one of the following happens:

  • IllegalArgumentException is thrown because the ciphertext of the encrypted number is greater than the public key's modulus.
  • DecodeException is thrown because the decrypted value cannot be decoded as a double.
  • successful decryption process, but the value is incorrect.

It would be good if CLI checks whether the correct private key is used (especially when the encrypted number is successfully decrypted).

@unzvfu
Copy link

unzvfu commented Sep 27, 2017

Cf. #66

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

No branches or pull requests

2 participants