nucypher / pyUmbral

NuCypher's reference implementation of Umbral (threshold proxy re-encryption) using OpenSSL and Cryptography.io
https://pyumbral.readthedocs.io
GNU General Public License v3.0
285 stars 71 forks source link

Final touches for the API #270

Closed fjarri closed 3 years ago

fjarri commented 3 years ago

Synced with https://github.com/nucypher/rust-umbral/pull/50

https://github.com/nucypher/nucypher/pull/2612 uses this branch in CI

cygnusv commented 3 years ago
  • rename pk to delegating_pk in encrypt()

Rather than delegating_pk, this should be a simple encrypting_pk. One of the core propositions of PRE is that delegation is completely orthogonal to encryption.

  • rename decrypting_sk to delegating_sk in decrypt_original()
  • rename decrypting_sk to receiving_sk in decrypt_reencrypted()

I don't get this distinction between delegating and receiving. In both cases it's "receiving"; "decrypting" also works.

fjarri commented 3 years ago

I don't get this distinction between delegating and receiving. In both cases it's "receiving"; "decrypting" also works.

Here's my rationale:

First, the encrypting/decrypting prefixes. I think they are redundant; if you are passing a key to encrypt/decrypt, these keys are by default used for encrypting/decrypting (while other usages still warrant a prefix, like verifying_key).

Now for the delegating/receiving prefixes. While it's true that one can use Umbral as a simple asymmetric encryption scheme (and we do use it that way to encrypt kfrags for Ursula), it is not the intended usage, and, in fact, an overkill. I wanted to emphasize that: