1.0.0 • Published 2 months ago

@dneeraj123/http_ece v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

encrypted-content-encoding

This fork deals with base64 encoding issue of the buffer data.

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.

1.0.0

2 months ago