@fusedb/crypto
Version:
A FUSE middleware to handle data encryption.
77 lines (51 loc) โข 1.92 kB
Markdown
# ๐งฉ FUSE Middleware: Crypto
> A [FUSE](https://github.com/Fast-Unified-Storage-Engine/FUSE) middleware that provides AES encryption to your data


[](./LICENSE)

## ๐ฆ Installation
```bash
npm install @fusedb/core
npm install @fusedb/crypto
```
## ๐ Usage
```js
const FUSE = require("@fusedb/core");
const JSONDriver = require("@fusedb/json");
const Crypto = require("@fusedb/crypto");
const db = new FUSE({
driver: new JSONDriver({ path: "./data.json" }),
middleware: [
new Crypto({
key: process.env.DB_KEY || "12345678901234567890123456789012",
})
]
});
```
## โ๏ธ Options
| Option | Type | Description |
| ------ | ----- | --------------------------------------------- |
| `key` | `string` | *A 32 character long string for the encryption key* |
## โ
Features
* โ
Works with any FUSE driver
* โ
Compatible with `.get()`, `.set()`, `.bulkSet()`, etc.
* โ
AES-256-GCM encryption
## ๐ Related
* [FUSE Core](https://www.npmjs.com/package/@fusedb/core)
* [FUSE Github](https://github.com/Fast-Unified-Storage-Engine/FUSE)
* [Middleware API Specification](https://github.com/Fast-Unified-Storage-Engine/FUSE/blob/main/MIDDLEWARE_SPECIFICATION.md)
## ๐ค Contributing
Want to make your own middleware?
* Name it like: `fusedb-<name>` or `@your-org/fusedb-<name>`
* Follow the [Middleware Guidelines](https://github.com/fusedb/.github/blob/main/CONTRIBUTING.md)
Feel free to share your plugin with the community!
## ๐งพ License
Licensed under the [Apache-2.0](./LICENSE).