mirror of https://github.com/status-im/js-waku.git
Mention Eth-PM
This commit is contained in:
parent
cc84edca9c
commit
6e5cbefc49
|
@ -262,3 +262,18 @@ waku.relay.addObserver((message) => {
|
|||
console.log(message.payload); // This payload is decrypted
|
||||
}, [contentTopic]);
|
||||
```
|
||||
|
||||
|
||||
## Code Example
|
||||
|
||||
The [Eth-PM](https://github.com/status-im/js-waku/tree/main/examples/eth-pm) Web App example demonstrates both the use of symmetric and asymmetric encryption.
|
||||
|
||||
Asymmetric encryption is used for private messages so that only the intended recipient can read said messages.
|
||||
|
||||
Symmetric encryption is used for the public key messages.
|
||||
In this instance, the same key is used for all users: the Keccak-256 hash of the content topic (which results in 32 bytes array).
|
||||
While this does not add functional value, it does demonstrate the usage of symmetric encryption in a web app.
|
||||
|
||||
A live version of Eth-PM can be found at https://status-im.github.io/js-waku/eth-pm/.
|
||||
|
||||
The specifications of the protocol it implements can be found at [20/TOY-ETH-PM](https://rfc.vac.dev/spec/20/).
|
||||
|
|
Loading…
Reference in New Issue