Mayank Agarwal has Published 307 Articles

process.argv() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 13:13:32

5K+ Views

The process.argv() method is used for returning all the command-line arguments that were passed when the Node.js process was being launched. The first element will always contains the same value as process.execPath.Syntaxprocess.argv()ParametersSince it returns all the command line arguments passed before the node.js process. It does not need any inputs ... Read More

decipher.update() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 13:12:29

441 Views

The decipher.update() is used to update the decipher with the receivd data according to the given encoding format. It is one of the inbuilt method that is provided by the class Decipher within the crypto module. If an input encoding is specified, the data argument is a string, else the ... Read More

Decipher.final() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 13:04:29

413 Views

The decipher.final() is used to return a buffer or string containing the value of decipher object. It is one of the inbuilt method that is provided by the class Cipher within the crypto module. The decipher method cannot be used to decrypt data once the decipher.final method has been called. ... Read More

crypto.scrypt() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 13:04:04

861 Views

The crypto.scrypt() method provides an asynchronous implementation for scrypt method. The scrypt can be defined as a password-based key derivation function that protects the system from the brute-force attacks and makes it unawarding. But the script function is expensive computationally as well as memory-wise.Syntaxcrypto.scrypt(password, salt, keylen, [options], [callback])ParametersThe above parameters ... Read More

crypto.randomFillSync() Method in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 20-May-2021 13:03:17

501 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

crypto.randomFill() Method in Node.js

Mayank Agarwal

Mayank Agarwal

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

288 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

crypto.getHashes() Method in Node.js

Mayank Agarwal

Mayank Agarwal

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

278 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.getCurves() Method in Node.js

Mayank Agarwal

Mayank Agarwal

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

351 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

318 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.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

Advertisements