Skip to content

How to set the Private-Key without generate_private_key? #64

@hatem-amer

Description

@hatem-amer

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions