Coder Social home page Coder Social logo

negrel / http_ece Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 162 KB

HTTP Encrypted Content-Encoding (RFC 8188) for Deno and web browsers

License: MIT License

TypeScript 97.33% Makefile 0.96% Nix 1.68% Shell 0.03%
deno encrypted-content-encoding http js rfc8188 ts

http_ece's Introduction

http-ece - HTTP Encrypted Content-Encoding for Deno & web browsers

jsr badge license MIT badge code size badge

This library is an implementation of HTTP Encrypted Content-Encoding scheme(RFC 8188).

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.

http-ece is available on JSR.

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

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)

TODO

Contributing

If you want to contribute to http_ece to add a feature or improve the code contact me at [email protected], open an issue or make a pull request.

๐ŸŒ  Show your support

Please give a โญ if this project helped you!

buy me a coffee

๐Ÿ“œ License

MIT ยฉ Alexandre Negrel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.