Citiverse
  • silverpill@mitra.socialS
    72
    0

    @greyarea

    >If the proof covers all of that then it's not strictly needed, but it's cheap paranoia.

    Do you mean id/actor/to of a plaintext activity, or of an envelope (EncryptedActivity)?

    My understanding is that the properties of an envelope have no effect on security. It can even have a different actor.

    I added an example of a plaintext activity: https://codeberg.org/silverpill/feps/src/branch/main/0806/fep-0806.md#plaintext-activity

    Also added HPKE mode to the parameter list - mode_base.

  • ?
    10
    0

    @silverpill

    Of an envelope. If actor being changed mid-transit isn't a problem, then omit it from the aad. Including the from/to as part of the AAD binds the ciphertext to the origin/recipient (the HPKE ciphertext does not carry any of this information).

    It is worth noting that, as the FEP is specified now, using the sender and recipient's keypairs to do HPKE will result in the same shared secret being generated for every message. This is catastrophic to security as the nonce for the symmetric portion of the HPKE encryption is deterministic (RFC 9180 5.1).

    This can be avoided by either: having the sender generate an ephemeral keypair (include the public key envelope), or using a unique HPKE info per envelope. The former is better as it gives imperfect forward secrecy (sender identity key compromise does not reveal past plaintexts), the latter is cheaper to do.

  • silverpill@mitra.socialS
    72
    0

    @greyarea

    having the sender generate an ephemeral keypair (include the public key envelope)

    So the recipient will need to encrypt to this ephemeral key when replying?

  • ?
    10
    0

    @silverpill

    No, the recipient would also generates an ephemeral key, and uses that when replying.

    So it's always a one shot ephemeral (sender)/static (recipient) HPKE exchange, with sender authenticity guaranteed by the signature. Could also use the shared secret from the original post but force a different IV, but "replies are just the sender and receiver being flipped, code path is the same" is easier.

  • silverpill@mitra.socialS
    72
    0

    @greyarea I assume this is "Authentication Using an Asymmetric Key" (https://www.rfc-editor.org/rfc/rfc9180.html#name-authentication-using-an-asy)?

    Because in "Encryption to a Public Key" mode, sender's key is not used.

    If I understand the idea correctly, the ephemeral key would need to be added to fep0806:cipherData. That is, instead of encap_key | ciphertext it will be ephemeral_key_pub | encap_key | ciphertext.

  • ?
    10
    0

    @silverpill

    If the signature in proof covers fep0806:cipherData, you can do ephemeral_key_pub | ciphertext. and use Encryption to a Public Key.

  • silverpill@mitra.socialS
    72
    0

    @greyarea Yes, proof covers all properties of the activity. But I can't omit encap_key, it is required by SetupBaseR function defined in section 5.1.1

    I've read a bit more about DHKEM and now I am even more confused. Isn't encap_key an ephemeral key? The library I am using describes it as such:

    https://docs.rs/hpke/latest/hpke/trait.Kem.html#tymethod.encap_with_rng

    Derives a shared secret and an ephemeral pubkey that the owner of the reciepint’s pubkey can use to derive the same shared secret.

    This "ephemeral pubkey" is what I labeled as encap_key. It is later included in fep0806:cipherData

    -----

    I think it's okay to have no forward secrecy, the goal of this FEP is to describe a simple encryption mechanism that anyone can implement. I'll just warn readers about its weakness.

  • ?
    10
    0

    @silverpill

    Ah , mea culpa, you're right. 5.1.1 avoids the nonce reuse issue and provides imperfect forward secrecy. I've been fighting u-boot on "new" exotic target the last day so my thinking isn't as sharp as it should be.

    Replies should go through the same process (avoids sender having to store the shared secret, less state is more better in this case).

  • ?
    10
    0

    @silverpill

    Think 5.1.3 (AuthEncap) is better since it still uses an ephemeral key, but does an extra DH to authenticate the sender. 5.1.1 (Encap) is simpler, but unless the aad contains at least the sender's identity, there is nothing preventing someone from extracting a ciphertext, and re-signing it (forging the origin).

    Having a trivial amount of AAD is computationally cheaper than doing the extra DH, but the extra DH would be sub 100 usec, so this is "pick something to taste".

    ps: Spent the day chasing LLVM bugs, errors in this would be all mine.

  • silverpill@mitra.socialS
    72
    0

    @greyarea Alright, I implemented the auth mode. It's not difficult, but it requires the actor of outer activity to be the same as the actor of inner (plaintext) activity. With base mode (5.1.1), the actor of outer activity could be different, which means we can hide the real sender.

    Do you think it's worth doing this?

    I think authentication of the sender at the HPKE level shouldn't be necessary because the inner activity is self-authenticating (includes integrity proof).


Citiverse è un progetto che si basa su NodeBB ed è federato! | Categorie federate | Chat | 📱 Installa web app o APK | 🧡 Donazioni | Privacy Policy

Il server utilizzato è quello di Webdock, in Danimarca. Se volete provarlo potete ottenere il 20% di sconto con questo link e noi riceveremo un aiuto sotto forma di credito da usare proprio per mantenere Citiverse.