let sharedPoint = secp.getSharedSecret(ourPrivateKey, '02' + theirPublicKey)
Secp from what I understand, is only supposed to be for digital signatures. I currently understand that any encryption done with it could be cracked kinda easy.
let sharedX = sharedPoint.substr(2, 64)
var cipher = crypto.createCipheriv( 'aes-256-cbc', Buffer.from(sharedX, 'hex'), iv )
Still don't understand how the recepiant is getting the decryption key
The code looks familiar. It seems they are implementing nip 4, encrypted DMs, to send messages back and forth. It generates a shared secret, based on the sender's private key and the recipient's public key to encrypt the message (I think) so that the recipient can decrypt it.
reply
Yeah no kidding that's the code I'm referencing. NIP 4 was the link I was sent by SebasWouters when I asked what encryption algorithm its using.
reply