Skip to content

Check private key when decrypting from CLI #38

@mpnd

Description

@mpnd

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).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions