9.8. Bidirectional Encryption
9.8. Bidirectional Encryption
As discussed in Section 5.2, HPKE encryption is unidirectional from sender to recipient. Applications that require bidirectional encryption can derive necessary keying material with the secret export interface (Section 5.3). The type and length of such keying material depends on the application use case.
As an example, if an application needs AEAD encryption from the recipient to the sender, it can derive a key and nonce from the corresponding HPKE context as follows:
key = context.Export("response key", Nk)
nonce = context.Export("response nonce", Nn)
In this example, the length of each secret is based on the AEAD algorithm used for the corresponding HPKE context.
Note that HPKE's limitations with regard to sender authentication become limits on recipient authentication in this context. In particular, in the Base mode, there is no authentication of the remote party at all. Even in the Auth mode, where the remote party has proven that they hold a specific private key, this authentication is still subject to key-compromise impersonation, as discussed in Section 9.1.1.