An example of how one might encrypt/decrypt files using node.
Code for this companion article: Encrypting Files With Node.
This code is adapted from the original. The original repo can be found here: https://github.com/bbstilson/node-encryption
- Add Node bin and Shebang to use as CLI tool. - F1LT3R
- Add linting inputs and vscode settings. - F1LT3R
- Add password, and password verification input. - F1LT3R
npm install
- From your shell:
aes encrypt test.txt
- You will be prompted for a password, and password verification.
- You will now see
test.txt.enc
. This is the encrypted data. - You can delete the original file, if you like.
- From your shell:
aes decrypt test.txt
- You will be prompted for a password, and password verification.
- You will now see
test.txt.unenc
. This file will be identical to the original. - You can rename this file back to
test.txt
.