0.1.0 • Published 8 months ago
@negrel/http_ece v0.1.0
http_ece
- HTTP Encrypted Content-Encoding for Deno & web browsers
This library is an implementation of HTTP Encrypted Content-Encoding scheme(RFC 8188).
Implemented schemes
This crate implements only the published Web Push Encryption scheme
(aes128gcm
), and not the legacy scheme from earlier drafts.
It does not support, and we have no plans to ever support, the obsoletes
aesgmc
and aesgcm128
schemes from earlier drafts.
Usage
import * as ece from "https://deno.land/x/http_ece@v0.0.5/mod.ts";
const input = new TextEncoder().encode("I am the walrus");
const secret = new TextEncoder().encode("my_secret");
const encrypted = await ece.encrypt(input, secret);
const decrypted = await ece.decrypt(encrypted, secret);
console.log(new TextDecoder().decode(decrypted));
// output: I am the walrus
Package is also available as @negrel/http_ece
on NPM.
Features
aes128gcm
encryption and decryption- custom padding strategy supported
- Web browser compatible
TODO
- Support the Streams API
Contributing
If you want to contribute to http_ece
to add a feature or improve the code
contact me at negrel.dev@protonmail.com,
open an issue or make a
pull request.
:stars: Show your support
Please give a :star: if this project helped you!
:scroll: License
MIT © Alexandre Negrel
0.1.0
8 months ago