<div dir="ltr"><div class="gmail_default" style="font-size:small">OK, here is how I 'solved' the problem:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To encrypt, I establish a master secret using the key agreement information. I then derive encryption parameters (key, IV, MAC key) from that master key using a KDF and a unique 128+ bit nonce(salt). Key = KDF (salt, "encrypt") and so on</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I encrypt the plaintext, calculate the digest of the ciphertext and sign.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To provide proof of knowledge of the plaintext, I provide a separate witness value Witness = KDF (salt, Signature) and provide that as an opaque value together with the signature. This has some very interesting properties.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">One of the most important for me is that I only require the signature to be authorized by a party with actual knowledge of the key exchange parameters. It is not necessary for the signer to have the plaintext, just the digest. This is much easier to support when the signer is a remote device. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">While this does not eliminate all the possibilities of protocol confusion arising from what the signer intended, I don't think the signing order is sufficient to address those either. Those are questions of cryptographic application design and it is naive to think that a single approach can address every concern in every case. It is not Alice who encrypts the message it is a collection of computer systems nominally under her control that sign the message.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_quote"></div></div>