How to use the createDiffieHellmanGroup function from crypto

Find comprehensive JavaScript crypto.createDiffieHellmanGroup code examples handpicked from public code repositorys.

-1
fork icon0
star icon0
watch icon0

+ 3 other calls in file

171
172
173
174
175
176
177
178
179
180
181
assert.throws(() => {
  dh3.computeSecret('');
}, { message: 'Supplied key is too small' });


// Create a shared using a DH group.
const alice = crypto.createDiffieHellmanGroup('modp5');
const bob = crypto.createDiffieHellmanGroup('modp5');
alice.generateKeys();
bob.generateKeys();
const aSecret = alice.computeSecret(bob.getPublicKey()).toString('hex');
fork icon0
star icon0
watch icon0

+ 20 other calls in file