feat: "manual encryption of flows_cred.json" #9

Merged
jon_nfc merged 6 commits from 4-flow-cred into development 2023-08-15 07:32:46 +00:00
3 changed files with 41 additions and 4 deletions
Showing only changes of commit 93fad13681 - Show all commits

10
decrypt-flows-cred.sh Normal file → Executable file
View File

@ -10,12 +10,16 @@
# 2023-08-14: Fetched script from original source <https://blog.hugopoi.net/en/2021/12/28/how-to-decrypt-flows_cred-json-from-nodered-data/>
# Credit to the original author/creator.
# 2023-08-14: Adjusted to prompt for password when running command.
# 2023-08-14: Adjusted to output to a file called 'flows_cred.json.tmp'
#
echo -n "Please enter the flows_cred.json decryption key: ";
read -s PASSWORD
echo.
echo;
jq '.["$"]' -j $1/flows_cred.json | \
DecryptedData=$(jq '.["$"]' -j $1/flows_cred.json | \
cut -c 33- | \
openssl enc -aes-256-ctr -d -base64 -A -iv `jq -r '.["$"]' $1/flows_cred.json | cut -c 1-32` -K `echo -n $PASSWORD | sha256sum | cut -c 1-64`
openssl enc -aes-256-ctr -d -base64 -A -iv `jq -r '.["$"]' $1/flows_cred.json | cut -c 1-32` -K `echo -n $PASSWORD | sha256sum | cut -c 1-64`)
echo -n $DecryptedData > $1/flows_cred.json.tmp
#echo -n $DecryptedData