https://github.com/negrel/http-ece
HTTP Encrypted Content-Encoding (RFC 8188) for Deno and web browsers
https://github.com/negrel/http-ece
deno encrypted-content-encoding http js rfc8188 ts
Last synced: about 1 month ago
JSON representation
HTTP Encrypted Content-Encoding (RFC 8188) for Deno and web browsers
- Host: GitHub
- URL: https://github.com/negrel/http-ece
- Owner: negrel
- License: mit
- Created: 2022-07-29T23:07:32.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T18:29:37.000Z (11 months ago)
- Last Synced: 2025-04-24T18:53:29.359Z (about 1 month ago)
- Topics: deno, encrypted-content-encoding, http, js, rfc8188, ts
- Language: TypeScript
- Homepage:
- Size: 158 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `http-ece` - HTTP Encrypted Content-Encoding for Deno & web browsers


This library is an implementation of HTTP Encrypted Content-Encoding
scheme([RFC 8188](https://datatracker.ietf.org/doc/html/rfc8188)).> NOTE: This library hasn't been reviewed by crypto experts and may be unsecure.
> I've done my best to follow RFC recommandation and I only used primitives
> provided by the
> [SubtleCrypto API](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto).`http-ece` is available on [JSR](https://jsr.io/@negrel/http-ece).
## 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 obsolete `aesgmc`
and `aesgcm128` schemes from earlier drafts.## Usage
```ts
import * as ece from "jsr:@negrel/http-ece";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
```## Features
- `aes128gcm` encryption and decryption
- custom padding strategy supported
- Web browser compatible (based on
[SubtleCrypto](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto))## TODO
- [ ] Support
[Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API)## Contributing
If you want to contribute to `http_ece` to add a feature or improve the code
contact me at [[email protected]](mailto:[email protected]),
open an [issue](https://github.com/negrel/http_ece/issues) or make a
[pull request](https://github.com/negrel/http_ece/pulls).## :stars: Show your support
Please give a :star: if this project helped you!
[](https://www.buymeacoffee.com/negrel)
## :scroll: License
MIT © [Alexandre Negrel](https://www.negrel.dev/)