How to set the Private-Key without generate_private_key?

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js
Domain
backend, security

Research direction

Start at the ece.decrypt entry point and inspect how its privateKey parameter is handled. Compare that behavior with the Node.js crypto.createECDH and setPrivateKey example in the issue; done when the supported way to provide the key is documented or the missing capability is clearly identified.

Written by the indexing model from the issue text.

Description

In Node Js this done as follows:

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

const dh = crypto.createECDH('prime256v1');
dh.setPrivateKey("d25a7249abac3beae6d03e0441867de762ea4cfc51e5c202a3fc0a45486d1f94", 'hex');
const params = {
    version: 'aes128gcm',
    authSecret: "a7omShAT1ycPQqu9UHaS6Q",
    privateKey: dh,
};
const buf = Buffer.from(array2, 'hex'); 
const decrypted = ece.decrypt(buf, params);
console.log(decrypted.toString());
Dominant language
JavaScript
Stars
33
Forks
26
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web-push-libs/encrypted-content-encoding

All issues in web-push-libs/encrypted-content-encoding

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.