Mayank Agarwal has Published 380 Articles

crypto.publicDecrypt() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:52:27

523 Views

The crypto.publicDecrypt() is used for decrypting the given data in buffer with public key. This buffer was encrypted by using the corresponding private key i.e. crypto.privateEncrypt() method.Syntaxcrypto.publicDecrypt(key, buffer)ParametersThe above parameters are described as below −key – It can contain the below 5 types of data of the following type – Object, ... Read More

crypto.privateEncrypt() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:51:58

519 Views

The crypto.privateEncrypt() is used for encrypting the given data content by using the given private key parameter passed in the function.Syntaxcrypto.privateEncrypt(privateKey, buffer)ParametersThe above parameters are described as below −privateKey – It can contain following data types – Object, String, Buffer or KeyObject.key – This key is a 'PEM' encoded private key. The ... Read More

crypto.getHashes() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:51:30

136 Views

The crypto.getHashes() method will return an array that contains names of all the supported hash algorithms. The crypto package has a huge list of hash algorithms we can use. But the most used cipher algorithm is 'MD5 – Message-Digest Algorithm5 '.Syntaxcrypto.getHashes()ParametersSince it returns a list of all the hash algorithms. ... Read More

crypto.getDiffieHellman() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:50:59

123 Views

The crypto.createDiffieHellmanGroup() is used for creating a pre-determined DiffieHellmanGroup key exchange object. Some of the supported DiffieHellmanGroups are: modp1, modp2, modp5, modp 14, modp16, modp17 etc. The benefit of using this method is that the parties don't need to generate or exchange a group modulus thus saving processing time.Syntaxcrypto.getDiffieHelmmanGroup(groupName)ParametersThe above ... Read More

crypto.getCurves() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:32:35

225 Views

The crypto.getCurves() method will return an array that contains names of all the supported elliptic curves. The crypto package has a huge list of elliptic curves that can be used for creating Elliptic Curve Diffie-Hellman (ECDH) key exchange objectSyntaxcrypto.getCurves()ParametersSince it returns a list of all the elliptic curves. It does ... Read More

crypto.getCiphers() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:31:42

190 Views

The crypto.getCiphers() method will return an array that contains names of all the supported cipher algorithms. The crypto package has a huge list of cipher algorithms we can use. But the most used cipher algorithm is 'AES – Advanced Encryption Standard'.Syntaxcrypto.getCiphers()ParametersSince it returns a list of all the cipher algorithms. ... Read More

crypto.generateKeyPairSync() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:30:52

1K+ Views

The crypto.generateKeyPairSync() can be used to generate a new asymmetric key pair of the specified type in a sync flow. Supported types for generating key pair are: RSA, DSA, EC, Ed25519, Ed448, X25519, X448 and DH. The function behaves as if keyObject.export has been called on its result when a ... Read More

crypto.generateKeyPair() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:30:25

2K+ Views

The crypto.generateKeyPair() can be used to generate a new asymmetric key pair of the specified type. Supported types for generating key pair are: RSA, DSA, EC, Ed25519, Ed448, X25519, X448 and DH. The function behaves as if keyObject.export has been called on its result when a publicKeyEncoding or privateKeyEncoding is ... Read More

crypto.createVerify() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:26:22

426 Views

The crypto.createVerify() will create and return a verify object that uses the passed algorithm in the parameter. One can use, crypto.getHashes() to get the names of all the available signing algorithms. You can create a Verify instance by using the name of the signature algorithms such as 'RHA-SHA256' only in ... Read More

crypto.createSign() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 12:23:51

230 Views

The crypto.createSign() will create and return a sign object tha uses the passed algorithm in the parameter. One can use, crypto.getHashes() to get the names of all the available digest algorithms. You can create a Sign instance by using the name of the signature algorithms such as 'RHA-SHA256' only in ... Read More

Advertisements