How to use the createDiffieHellmanGroup function from crypto
Find comprehensive JavaScript crypto.createDiffieHellmanGroup code examples handpicked from public code repositorys.
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');
0
0
0
+ 20 other calls in file
crypto.createHash is the most popular function in crypto (882 examples)