https://github.com/quirrel-dev/secure-e2ee
Secure end-to-end-encryption for Node.js.
https://github.com/quirrel-dev/secure-e2ee
nodejs quirrel typescript
Last synced: 11 months ago
JSON representation
Secure end-to-end-encryption for Node.js.
- Host: GitHub
- URL: https://github.com/quirrel-dev/secure-e2ee
- Owner: quirrel-dev
- Created: 2020-10-08T13:04:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-31T06:57:47.000Z (over 1 year ago)
- Last Synced: 2024-10-31T07:26:42.613Z (over 1 year ago)
- Topics: nodejs, quirrel, typescript
- Language: TypeScript
- Homepage:
- Size: 335 KB
- Stars: 30
- Watchers: 2
- Forks: 3
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# secure-e2ee
Secure end-to-end-encryption for Node.js and Browser.
## Usage
```ts
import Encryptor from "secure-e2ee";
const encryptor = new Encryptor(
// encryption secret
// needs to be 32 characters long
"e761daf732c272ee0db9bd71f49c66a0",
// old encryption secrets
// that have been rotated out.
// (optional)
[
"e761daf732c272ee0db9bd71f49c66a0",
"c272732c66aee0db9bd71f49e761daf0",
]
);
const cipher = encryptor.encrypt("I ❤️ Blitz.js");
// send over the wire
const original = encryptor.decrypt(cipher);
// original === "I ❤️ Blitz.js";
```