Tweak some wording

This commit is contained in:
Jonathan Staab 2023-08-12 14:05:41 -07:00
parent 06f8dbadc8
commit 3a37d7c8b9

6
44.md
View File

@ -6,9 +6,7 @@ Encrypted Payloads (Versioned)
`optional` `author:paulmillr` `author:staab` `optional` `author:paulmillr` `author:staab`
The NIP introduces a versioned encryption data model, allowing multiple algorithm choices to exist simultaneously. The NIP introduces a new data format for keypair-based encryption. This NIP is versioned to allow multiple algorithm choices to exist simultaneously.
The algorithm described in NIP-04 is potentially vulnerable to [padding oracle attacks](https://en.wikipedia.org/wiki/Padding_oracle_attack) and uses keys which are not indistinguishable from random. For more information, see [here](https://github.com/nostr-protocol/nips/pull/715#issuecomment-1675301250).
An encrypted payload MUST be encoded as a JSON object. Different versions may have different parameters. Every format has a `v` field specifying its version. An encrypted payload MUST be encoded as a JSON object. Different versions may have different parameters. Every format has a `v` field specifying its version.
@ -38,6 +36,8 @@ Example:
By default in the [libsecp256k1](https://github.com/bitcoin-core/secp256k1) ECDH implementation, the secret is the SHA256 hash of the shared point (both X and Y coordinates). We are using this exact implementation. In NIP-94, unhashed shared point was used. By default in the [libsecp256k1](https://github.com/bitcoin-core/secp256k1) ECDH implementation, the secret is the SHA256 hash of the shared point (both X and Y coordinates). We are using this exact implementation. In NIP-94, unhashed shared point was used.
This encryption scheme replaces the one described in NIP-04, which is not secure. It used bad cryptographic building blocks and must not be used.
# Code Samples # Code Samples
## Javascript ## Javascript