- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Mayank Agarwal has Published 380 Articles
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
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