I'm working in the Curve25519 domain (EC curve, 256-bit key size). I have a peer pubkey, and need to send it an encrypted message.
For starters we create a "nonce" (ephemeral key), and use it to derive a DH shared secret. Then it's usually used to initialize a symmetric key (i.e. AES or similar) to encrypt the actual message. But my message is only 256-bit size (yet another key), and I don't need things like HMAC. So I thought about just XOR-ing the key with the shared secret.
Is this scheme good enough?
If I'm not mistaken, the DH shared secret is actually an X-coordinate of the EC point (in affine coordinates). And, strictly speaking, not all values are possible (little less than half actually). But this seems to be a minor consideration.