Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda