How to Encrypt and Decrypt with NodeJSโ€‚by@alexadam

How to Encrypt and Decrypt with NodeJS

How to encrypt text: create a file named encdec.js and paste: require('crypto')const encrypt = (plainText, password) Then run: encode, decrypt, encode and test: "Hello World," "secret1234" Then run the decryption function: "decrypted" and "encrypted" output: Hello World.js. Then run encode and decrypt: "Decry" and encode text: "Hey World. What do you know? How do we know?"
image
Alex Adam Hacker Noon profile picture

Alex Adam

Creative Coder

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.