@@ -22,7 +22,7 @@ introduction: a proof-of-concept, or just fun.
2222## Security details
2323
2424Encryption is done with AES-256-GCM and key derivation with PBKDF2 with SHA-384.
25- The Salt and Initialization Vector are generated with Crypto.getRandomValues.
25+ The Salt and Initialization Vector are generated with ` Crypto.getRandomValues ` .
2626There are only three configurable options:
2727
2828- The number of iterations for PBKDF2.
@@ -44,17 +44,23 @@ const store = subtleCryptoStore(window.crypto, backend, 'my super pass', {
4444});
4545```
4646
47+ * NOTE* : these options are very strictly expected to be finite, positive
48+ integer values of typr ` number ` . If you supply something like ` '16' ` or ` 16.1 `
49+ that value will be dropped and a default used. Use predefined constants,
50+ sanitize your input or check the returned ` options ` member, which contains the
51+ parameters being used.
52+
4753## Compatibility
4854
4955Source code is written in typescript targetting es2016. By then Crypto and
5056SubtleCrypto APIs were already available in most major browsers.
5157
5258Crypto and SubtleCrypto APIs are only available in a
5359[ Secure Context] ( https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts ) .
54- For browsers, this means that the Window or Worker have an HTTPS origin, and if
55- the window belongs to an iframe, then all its ancestors are also delivered
60+ For browsers, this means that the ` Window ` or ` Worker ` have an HTTPS origin, and
61+ if the window belongs to an iframe, then all its ancestors are also delivered
5662through HTTPS. There are other cases as well, you can read the linked document
5763for more information. At runtime, the global and raeadonly property
5864[ isSecureContext] ( https://developer.mozilla.org/en-US/docs/Web/API/isSecureContext )
5965can be used to easily detect the availability of these features, so if it
60- returns true then you should have access to these APIs.
66+ returns ` true ` then you should have access to these APIs.
0 commit comments