X-Git-Url: http://git.squeep.com/?p=squeep-mystery-box;a=blobdiff_plain;f=README.md;fp=README.md;h=a8db0a66a986254f2c210c0662d76a96d4aaac19;hp=b7ad9d4fd0ac5dbff6aa89260295c221fc23113d;hb=a2c43375438f8fda039f5cff014246dffd00413f;hpb=835130ce146246eb06f82ccb61d78769dc8d32b2 diff --git a/README.md b/README.md index b7ad9d4..a8db0a6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ In our case, this results in a Base64URL encoded string containing a bespoke pac const { MysteryBox } = require('@squeep/mystery-box'); const assert = require('assert'); -const mb = new MysteryBox(console, { +const mb = new MysteryBox({ encryptionSecret: 'very secret', }); @@ -33,3 +33,7 @@ const mb = new MysteryBox(console, { This relies on AEAD ciphers, such as `aes-256-gcm` and `chacha20-poly1305`, to encrypt the payload and authenticate the additional metadata (version identifier, flags indicating payload details, the iv of the cipher, and the salt used to create the key) needed to decrypt the payload. For each box, a new key is generated using the stored secret and a securely-random salt by way of a mechanism such as an XOF such as `shake256`, a hash such as `blake2b512`, or a more time-consuming multi-round hash such as `scrypt`. This key is used to encrypt and authenticate the data and metadata, which is then encoded as a base64url string. + +## Statistics + +A `statistics` event is emitted for every pack or unpack, containing timing and other information.