The content field in a NIP-04(DM) event is encrypted using AES-256-CBC. To create the key you combine the recipients public key and the senders private key to get a shared key.

You can read more about it here: https://github.com/nostr-protocol/nips/blob/master/04.md

Reply to this note

Please Login to reply.

Discussion

I'm no cryptography expert though so I cant't explain to you how the key combination actually works.

Thanks!

Keys are combined with ECDH (Elliptic Curve Diffie-Hellman) which essentially is a kind of multiplication operation

It uses ECDH (the NIP probably should be more explicit)