SCRYPT demo in Node.JS v15

SCRYPT is yet another password-based key derivation function that allows you to tweak its arguments in order to discourage brute-force attacks. Basically you can adjust the options to make it slower, and therefore brute-force attacks will need more time to be performed. Here is an example of how to use SCRYPT to generate keys and IVs to use with all …

Password Based Key Derivation Function 2 (PBKDF2) demo in Node.JS v15

A quick demo on how to use Password Based Key Derivation Function 2 (PBKDF2) to generate keys and IVs to use with all different ciphers available in Node.JS v15.x. const crypto = require(‘crypto’); const PASSWORD = “My_Secret_Password”; // Could be the password/key used to encrypt a message const ITERATIONS = 10; const DIGEST = “sha256”; crypto.getCiphers().forEach(cipher => { let cipherInfo …

Node.JS Ciphers Info in version 15.x

After the deprecation of methods createCipher(…) and createDecipher(…) due to the introduction of createCipheriv(…) and createDecipheriv(…) a lot of us had issues when specifying the keys and IVs because sometimes the key would be the incorrect size and same for the IVs. I developed a kind of brute force tester to determine the correct values and keep them in a …