How to generate RSA key pair in Node.JS?

Very straight forward process. Not complicated at all, I would say that the most difficult part would be to actually tweak the options, however the code below actually works and provides you the time it took to generate the key pair as well, just for informational purposes. Run the following code in Node.js. const crypto = require(‘crypto’); const RSA = …