diff options
| author | Michael Dilger <mike@mikedilger.com> | 2024-02-16 15:54:47 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-15 23:54:47 -0300 |
| commit | 36d22815878186285825511358e66a52d2bf95e4 (patch) | |
| tree | 72fdfdeb75d8348a8eeff219c57a9b583af11fbd /49.md | |
| parent | 62c48eff58d6dd4d2b0a817bbb36cd75087f0ae3 (diff) | |
NIP-49 test vector for unicode normalization (#1054)
* NIP-49 [breaking]: password normalized to unicode NFKC format
* Test vector for unicode normalization
Diffstat (limited to '49.md')
| -rw-r--r-- | 49.md | 18 |
1 files changed, 16 insertions, 2 deletions
| @@ -78,6 +78,22 @@ The decryption process operates in the reverse. | |||
| 78 | Test Data | 78 | Test Data |
| 79 | --------- | 79 | --------- |
| 80 | 80 | ||
| 81 | ## Password Unicode Normalization | ||
| 82 | |||
| 83 | The following password input: "ÅΩẛ̣" | ||
| 84 | - Unicode Codepoints: U+212B U+2126 U+1E9B U+0323 | ||
| 85 | - UTF-8 bytes: [0xE2, 0x84, 0xAB, 0xE2, 0x84, 0xA6, 0xE1, 0xBA, 0x9B, 0xCC, 0xA3] | ||
| 86 | |||
| 87 | Should be converted into the unicode normalized NFKC format prior to use in scrypt: "ÅΩẛ̣" | ||
| 88 | - Unicode Codepoints: U+00C5 U+03A9 U+1E69 | ||
| 89 | - UTF-8 bytes: [0xC3, 0x85, 0xCE, 0xA9, 0xE1, 0xB9, 0xA9] | ||
| 90 | |||
| 91 | ## Encryption | ||
| 92 | |||
| 93 | The encryption process is non-deterministic due to the random nonce. | ||
| 94 | |||
| 95 | ## Decryption | ||
| 96 | |||
| 81 | The following encrypted private key: | 97 | The following encrypted private key: |
| 82 | 98 | ||
| 83 | `ncryptsec1qgg9947rlpvqu76pj5ecreduf9jxhselq2nae2kghhvd5g7dgjtcxfqtd67p9m0w57lspw8gsq6yphnm8623nsl8xn9j4jdzz84zm3frztj3z7s35vpzmqf6ksu8r89qk5z2zxfmu5gv8th8wclt0h4p` | 99 | `ncryptsec1qgg9947rlpvqu76pj5ecreduf9jxhselq2nae2kghhvd5g7dgjtcxfqtd67p9m0w57lspw8gsq6yphnm8623nsl8xn9j4jdzz84zm3frztj3z7s35vpzmqf6ksu8r89qk5z2zxfmu5gv8th8wclt0h4p` |
| @@ -86,8 +102,6 @@ When decrypted with password='nostr' and log_n=16 yields the following hex-encod | |||
| 86 | 102 | ||
| 87 | `3501454135014541350145413501453fefb02227e449e57cf4d3a3ce05378683` | 103 | `3501454135014541350145413501453fefb02227e449e57cf4d3a3ce05378683` |
| 88 | 104 | ||
| 89 | The reverse process is non-deterministic due to the random nonce. | ||
| 90 | |||
| 91 | Discussion | 105 | Discussion |
| 92 | ---------- | 106 | ---------- |
| 93 | 107 | ||