Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Is there a way for generation of ecdh shared key in 'node-forge' or other checked and secure js oackage

Well what i want to obtain is something like this

import * as forge from 'node-forge'
const aliceKey = forge.pki.ed25519.generateKeyPair();
const bobKey = forge.pki.ed25519.generateKeyPair();

//get shared secret for bob and alice
function getSharedKey(publicKey, privateKey){
//some code
}

const sharedKeyFromAlicePerspective = getSharedKey(bobKey.publicKey , aliceKey.privateKey);
const sharedKeyFromBobPerspective = getSharedKey(aliceKey.publicKey, bobKey.privateKey);

console.log(sharedKeyFromAlicePerspective === sharedKeyFromBobPerspective)//expect 'true'

Also i am open for changing library for other secure and well maintained and tested if its not possible in standard that this library provides (my point is to make smallest possible secure public keys for encryption beetween parties)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

well beside @Topaco answear i found out if you are in browser that support Crypto.subtle api you can do without modules.

const aliceKey = await window.crypto.subtle.generateKey({name: 'ECDH', namedCurve: 'P-521'},false, ['deriveBits']);
const bobKey = await window.crypto.subtle.generateKey({name: 'ECDH', namedCurve: 'P-521'},false, ['deriveBits']);
const secret = await window.crypto.subtle.deriveBits({
        name: "ECDH",
        namedCurve: "P-521",
        public: bobKey.publicKey
    },
    aliceKey.privateKey, 
    521
)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!