MCPcopy Create free account
hub / github.com/VadimNotJustDev/SignalClone / decryptMessage

Function decryptMessage

components/Message/Message.tsx:104–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102 }
103
104 const decryptMessage = async () => {
105 const myKey = await getMySecretKey();
106 if (!myKey) {
107 return;
108 }
109 // decrypt message.content
110 const sharedKey = box.before(stringToUint8Array(user.publicKey), myKey);
111 console.log("sharedKey", sharedKey);
112 const decrypted = decrypt(sharedKey, message.content);
113 console.log("decrypted", decrypted);
114 setDecryptedContent(decrypted.message);
115 };
116
117 decryptMessage();
118 }, [message, user]);

Callers 1

MessageFunction · 0.85

Calls 3

getMySecretKeyFunction · 0.90
stringToUint8ArrayFunction · 0.90
decryptFunction · 0.90

Tested by

no test coverage detected