http_ece

1.2.0 • Public • Published

encrypted-content-encoding

A simple implementation of the HTTP encrypted content-encoding

Use

var ece = require('http_ece');
var crypto = require('crypto')

var parameters = {
  key: crypto.randomBytes(16).toString('base64url'),
  salt: crypto.randomBytes(16).toString('base64url')
};
var encrypted = ece.encrypt(data, parameters);

var decrypted = ece.decrypt(encrypted, parameters);

require('assert').equal(decrypted.compare(data), 0);

This also supports the static-ephemeral ECDH mode. The source explains how.

TODO

Use the node streams API instead of the legacy APIs.

Readme

Keywords

none

Package Sidebar

Install

npm i http_ece

Weekly Downloads

138,669

Version

1.2.0

License

MIT

Unpacked Size

17.2 kB

Total Files

3

Last publish

Collaborators

  • martinthomson