Releases and notable changes to this project are documented here.
-## [Unreleased] - TBD
+## [v2.0.0] - 2023-03-18
+
+### Changed
+
+- *BREAKING CHANGE*: constructor no longer accepts a logger argument. Events are now emitted for the statistics which were the only use of the logger.
+- Custom errors are thrown instead of generic.
## [v1.2.2] - 2023-03-14
---
-[Unreleased]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=HEAD;hp=v1.2.1
+[Unreleased]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=HEAD;hp=v2.0.0
+[v2.0.0]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v2.0.0;hp=v1.2.2
[v1.2.2]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v1.2.2;hp=v1.2.1
[v1.2.1]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v1.2.1;hp=v1.2.0
[v1.2.0]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v1.2.0;hp=v1.1.1
const { MysteryBox } = require('@squeep/mystery-box');
const assert = require('assert');
-const mb = new MysteryBox(console, {
+const mb = new MysteryBox({
encryptionSecret: 'very secret',
});
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.