Suggest JS-SDK to increase ECIES program

Messages can be encrypted and sent in AE JS-SDK. After sending, you cannot decrypt the messages you sent. A set of ECIES hybrid encryption schemes is needed here, which is easy to implement in the SDK. The external build will be troublesome.

In some scenarios. Such as chat software? I need to ensure that the message is safe and reliable. At the same time, the messages I sent out, I hope that I am also visible.

@nduchak.chain Will you increase it?

eg:

1 Like
export function encryptData (msg, publicKey) {
  const ephemeralKeyPair = nacl.box.keyPair()
  const pubKeyUInt8Array = decodeBase58Check(assertedType(publicKey, 'ak'))
  const nonce = nacl.randomBytes(nacl.box.nonceLength)

Another example: SDK message sending forces the use of the public key of the other party. In group chat, sometimes I need to use my own private key to encrypt. The user who gets the message uses my public key to encrypt.

Of course, maybe group chat is not a good scene. However, people often hope that their messages are not absolutely confidential and can prove that they are sent.

1 Like

I think this is above the scope of what the JS-SDK is supposed to provide. For group chat you would encrypt the message for each participant separately, yourself included.

No, I don’t think it goes beyond the sdk. I give examples of chat systems and group chat systems, just because it is easier to understand.

For example: I have a very important document. This is the result of my research with bob. I want to keep it forever, and no one knows what it is. But both me and bob need to know it. I encrypted it and sent it to bob, so that both me and bob own it. But one day bob died and this tx is now rubbish for me.

Of course, maybe you can say, just send a copy to bob and send another copy to me.

1 Like

thats how asymetric cryptography works.

But we can do better. Why not?

We can implement the principle of asymmetric cryptography, but we can also use asymmetric cryptography with symmetric cryptography to complete the way that both parties do not need to remember the aes password, and safely keep the files of both parties.