You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ First: this library only makes sense if your clients sit behind a firewall, or i
6
6
7
7
This library monkey-patches either the Firebase Admin SDK or the Firebase JavaScript Client SDK to automatically encrypt and decrypt keys and values of your choosing using AES-SIV, and to compress encrypted string values. Almost everything just works, except that `startAt` and `endAt` queries on encrypted data would produce randomly ordered results and so are forbidden. `equalTo` queries will work fine, however, since a given plaintext value will always encrypt to the same ciphertext — but it will also let an attacker know if any two values are equal, even if they don't know what they are.
8
8
9
-
The library works both in Node (20.x+) and in the browser. In the browser, you need to also load [`crypto-js`](https://github.com/brix/crypto-js) (the following modules are sufficient: `core.js`, `lib-typedarrays.js`, `enc-base64.js`, `enc-base64url.js`, `sha1.js`, `md5.js`, `evpkdf.js`, `cipher-core.js`, `aes.js`, `mode-ctr.js`) and [`cryptojs-extension`](https://github.com/artjomb/cryptojs-extension) (only `build/siv.js` is required). If you want to enable caching to enhance performance, then in the browser you'll also want to load [`node-lru-cache`](https://github.com/isaacs/node-lru-cache). All these libraries are automatically included in the Node distribution.
9
+
The library works both in Node (20.x+) and in the browser. In the browser, you need to also load [`crypto-js`](https://github.com/brix/crypto-js) (the following modules are sufficient: `core.js`, `lib-typedarrays.js`, `enc-base64.js`, `enc-base64url.js`, `sha1.js`, `md5.js`, `evpkdf.js`, `cipher-core.js`, `aes.js`, `mode-ctr.js`) and [`cryptojs-extension`](https://github.com/artjomb/cryptojs-extension) (only `build/siv.js` is required). If you want to enable caching to enhance performance, then in the browser you'll also want to load [`lru-cache`](https://github.com/isaacs/node-lru-cache) into the `lrucache` global variable. All these libraries are automatically included in the Node distribution.
10
10
11
11
Upon requiring this library, the `admin.database()` or `firebase.database()` method as well as the
12
12
`app.App.database()` methods are monkey-patched to return a custom `FireCrypt` instance in place of
@@ -54,7 +54,7 @@ The `options` are as follows:
54
54
*`keyCheckValue`: a value generated by a previous call to `configureFireCrypt()` used to verify that the `aes-siv``key` used in both calls is the same. If a different key was used to generate the `keyCheckValue` then an error with `firecrypt === 'WRONG_KEY'` will be thrown.
55
55
* For convenience, the `keyCheckValue` is also available at any time via
56
56
`admin.database().encryptionKeyCheckValue` or `firebase.database().encryptionKeyCheckValue`.
57
-
*`cacheSize`: the maximum size in bytes of the encryption and decryption caches, used to improve performance. In the browser, the caches will only be activated if `LRUCache` is defined; it should conform to the API of [`node-lru-cache`](https://github.com/isaacs/node-lru-cache). You can also specify `encryptionCacheSize` and `decryptionCacheSize` separately.
57
+
*`cacheSize`: the maximum size in bytes of the encryption and decryption caches, used to improve performance. In the browser, the caches will only be activated if `lrucache.LRUCache` is defined; it should conform to the API of [`lru-cache`](https://github.com/isaacs/node-lru-cache). You can also specify `encryptionCacheSize` and `decryptionCacheSize` separately.
58
58
*`compression`: the compression algorithm to use. Currently supported values are:
59
59
*`deflate`: the classic, low-overhead deflate algorithm.
0 commit comments