It should be. Well let's introduce Charlie to the example in the docs:

charlie.generateKeys();
var alice_secret = alice.computeSecret(bob.getPublicKey(), 'binary', 'hex');

Now how to incorporate Charlie's public key in Alice's secret? This is
not allowed:
alice_secret = alice_secret.computeSecret(charlie.getPublicKey(),
'binary', 'hex');

Nor does this work since it discards the previous result:
var alice_secret = alice.computeSecret(charlie.getPublicKey(), 'binary', 'hex');

Am I missing something obvious or should the API be extended?


Thanks
Antoine


On Thu, Oct 18, 2012 at 4:07 PM, Ben Noordhuis <[email protected]> wrote:
> On Thu, Oct 18, 2012 at 1:44 PM, Antoine van Wel
> <[email protected]> wrote:
>> Is it possible with the current crypto impl to compute a
>> Diffie-Hellman shared key among 3 participants?
>
> I've admittedly never tried it myself but I don't see why that
> couldn't work, the computeSecret() method takes an arbitrary key. It's
> a thin wrapper around openssl's DH_compute_key() function.
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to