
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 373 Articles

Mayank Agarwal
462 Views
The crypto.randomFillSync() method takes a buffer argument and returns the buffer by filling it with its encrypted value. As the name suggests, this will be a sync process.Syntaxcrypto.randomFillSync(buffer, [offset], [size])ParametersThe above parameters are described as below −buffer – This field contains the data content. Possible buffer types are: string, TypedArray, Buffer, ... Read More

Mayank Agarwal
239 Views
Both the crypto.randomFill() method and crypto.randomBytes() method are almost same. The only difference between the two is that – In randomFill() method the first argument is a buffer that will be filled. It also has a callback method that is called when an error is encountered only if the callback ... Read More

Mayank Agarwal
2K+ Views
The crypto.publicEncrypt() is used for encrypting the given data in buffer parameter by using a public key passed in the parameter. The data returned can be decrypted using the corresponding private key.Syntaxcrypto.publicEncrypt(key, buffer)ParametersThe above parameters are described as below −key – It can contain the below 5 types of data of ... Read More

Mayank Agarwal
688 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
709 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
214 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
171 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
309 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
261 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
2K+ 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