Prep & Integration Of Single-file Encryption
Node.js and npm
Installing and maintaining can be a headache. I went with installation of a Node.js “version manager” for windows called
nvmornvm-windowsfor Windows. Installation file available at NVM, and downloads from github. I grabbed version 1.2.2.Then, open Powershell as an administrator, and use
nvm versionto check that installation worked.Use the LTS (long term support) version of Node for stability with
nvm install lts. Usenvm listto view available versions, andnvm use xx.xx.xxversion from the list. Try bothnode -vandnpm -vto check installation is complete, then close the admin Powershell.
StatiCrypt
- Open a new (non-admin) Powershell and run
npm install -g staticrypt.
That should do it?
Integration
I refactored build_script.py to run encryption after Pagefind indexing, because I have Pagefind set up to only index the title and keywords. This allows the search function to find encrypted files, but not reveal the sensitive data within. The encryption password is entered on the command line during script execution. I have tested, searched the Pagefind index, and attempted to break into the resulting site, and it seems highly effective.
The “salt” staticrypt.json file is generated/stored in the development directory, not in the source or destination directories. This is very fragile and will later require modification, but at this time the build script can only be run from the development folder locally, and this is functional. This allows me to continue to develop and assess new features slowly over time, but needs resolution prior to considering packaging for use on another system.