simple-hpke 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Simple HPKE
2
2
  [![tests](https://img.shields.io/github/actions/workflow/status/nichoth/simple-hpke/nodejs.yml?style=flat-square)](https://github.com/nichoth/simple-hpke/actions/workflows/nodejs.yml)
3
- [![types](https://img.shields.io/npm/types/@substrate-system/simple-hpke?style=flat-square)](README.md)
3
+ [![types](https://img.shields.io/npm/types/simple-hpke?style=flat-square)](README.md)
4
4
  [![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
5
5
  [![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
6
6
  [![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](./CHANGELOG.md)
7
- [![install size](https://flat.badgen.net/packagephobia/install/@substrate-system/simple-hpke)](https://packagephobia.com/result?p=@substrate-system/simple-hpke)
8
- [![gzip size](https://flat.badgen.net/bundlephobia/minzip/@substrate-system/simple-hpke)](https://bundlephobia.com/package/@substrate-system/simple-hpke)
7
+ [![install size](https://flat.badgen.net/packagephobia/install/simple-hpke)](https://packagephobia.com/result?p=simple-hpke)
8
+ [![gzip size](https://flat.badgen.net/bundlephobia/minzip/simple-hpke)](https://bundlephobia.com/package/simple-hpke)
9
9
  [![license](https://img.shields.io/badge/license-Big_Time-blue?style=flat-square)](LICENSE)
10
10
 
11
11
 
@@ -42,7 +42,7 @@ Hybrid Public Key Encryption
42
42
  ## Install
43
43
 
44
44
  ```sh
45
- npm i -S @substrate-system/simple-hpke
45
+ npm i -S simple-hpke
46
46
  ```
47
47
 
48
48
  ## Example
@@ -54,7 +54,7 @@ Wrap an AES key, or encrypt a message.
54
54
  Encrypt an AES key to yourself, then recover it later.
55
55
 
56
56
  ```ts
57
- import { seal, open } from '@substrate-system/simple-hpke'
57
+ import { seal, open } from 'simple-hpke'
58
58
 
59
59
  // An X25519 keypair. The private key can be non-extractable.
60
60
  // HPKE needs only `deriveBits`.
@@ -91,7 +91,7 @@ IV. The recipient uses their private key to open the AES key and decrypt
91
91
  the message.
92
92
 
93
93
  ```ts
94
- import { seal, open } from '@substrate-system/simple-hpke'
94
+ import { seal, open } from 'simple-hpke'
95
95
 
96
96
  const recipient = await crypto.subtle.generateKey(
97
97
  { name: 'X25519' },
@@ -155,10 +155,7 @@ cipher text). `decrypt` reverses it, returning the plaintext bytes.
155
155
 
156
156
 
157
157
  ```ts
158
- import {
159
- encrypt,
160
- decrypt
161
- } from '@substrate-system/simple-hpke'
158
+ import { encrypt, decrypt } from 'simple-hpke'
162
159
 
163
160
  // need a public key for the recipient
164
161
  const recipient = await crypto.subtle.generateKey(
@@ -221,7 +218,7 @@ for transports that carry text (JSON, URLs, headers). `opts.encoding` sets the
221
218
  string encoding. Default encoding is `base64url`.
222
219
 
223
220
  ```ts
224
- import { encrypt, decrypt } from '@substrate-system/ecies'
221
+ import { encrypt, decrypt } from 'simple-hpke'
225
222
  import { fromString } from 'uint8arrays'
226
223
 
227
224
  // recipient is any RecipientKey; keypair holds the matching private key
@@ -289,12 +286,12 @@ This exposes ESM and common JS via
289
286
 
290
287
  ### ESM
291
288
  ```js
292
- import { seal, open, encrypt, decrypt } from '@substrate-system/simple-hpke'
289
+ import { seal, open, encrypt, decrypt } from 'simple-hpke'
293
290
  ```
294
291
 
295
292
  ### Common JS
296
293
  ```js
297
- require('@substrate-system/simple-hpke')
294
+ require('simple-hpke')
298
295
  ```
299
296
 
300
297
  ### pre-built JS
@@ -303,7 +300,7 @@ accessible to your web server, then link to them in HTML.
303
300
 
304
301
  #### copy
305
302
  ```sh
306
- cp ./node_modules/@substrate-system/simple-hpke/dist/index.min.js ./public/hpke.min.js
303
+ cp ./node_modules/simple-hpke/dist/index.min.js ./public/hpke.min.js
307
304
  ```
308
305
 
309
306
  #### HTML