From a1f18b566eb99c3321eaaaaf6ce6a54159bedb92 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Sat, 23 May 2026 05:28:27 -0600 Subject: [PATCH] normalization --- Encrypt-Share-Attribution | 1 - out/README.md | 1 + out/contents/README.md | 1 + out/test_validate_passphrase.sh | 15 +++++++++++++++ out/verify-everything.sh | 29 +++++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) delete mode 160000 Encrypt-Share-Attribution create mode 100644 out/README.md create mode 100644 out/contents/README.md create mode 100755 out/test_validate_passphrase.sh create mode 100755 out/verify-everything.sh diff --git a/Encrypt-Share-Attribution b/Encrypt-Share-Attribution deleted file mode 160000 index e2a3f08..0000000 --- a/Encrypt-Share-Attribution +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e2a3f08b51ff9cf1f939faddf55085ef1f15a055 diff --git a/out/README.md b/out/README.md new file mode 100644 index 0000000..efbd52d --- /dev/null +++ b/out/README.md @@ -0,0 +1 @@ +# todo: make this nice diff --git a/out/contents/README.md b/out/contents/README.md new file mode 100644 index 0000000..53d7510 --- /dev/null +++ b/out/contents/README.md @@ -0,0 +1 @@ +put files to verifiably archive in here diff --git a/out/test_validate_passphrase.sh b/out/test_validate_passphrase.sh new file mode 100755 index 0000000..4172017 --- /dev/null +++ b/out/test_validate_passphrase.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e +attrib_hash=$(cat "./attribution.sha512") + +echo "enter passphrase to test" +read passphrase +echo + +tested_hash=$( ( echo -n "$passphrase"; cat "./contents.7z" ) | sha512sum | awk '{print $1}') + +if [[ "$attrib_hash" == "$tested_hash" ]]; then + echo -e "\n\nAttribution With Password $passphrase: \033[0;32mOK!\033[0m\n\n" +else + echo -e "Attribution With Password $passphrase: \033[0;31mFAIL!\033[0m" +fi diff --git a/out/verify-everything.sh b/out/verify-everything.sh new file mode 100755 index 0000000..162cf80 --- /dev/null +++ b/out/verify-everything.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +checkcode () { + if [ -z "$1" ]; then + echo -e "\n\e[31mERROR!\033[0m chkcode missing return code paramater\n" + exit 1 + else + retcode=$1 + fi + + if [ $retcode -ne 0 ]; then + echo -e "\t\e[31mERROR!\033[0m Response Code: $retcode" + else + printf '\e[1;32mOK!\e[0m\n' + fi +} + +printf "Testing contents.7z integrity... " +7z t contents.7z > /dev/null 2>&1 +checkcode $? + +printf "Checking sha512 checksums... " +sha512sum -c checksums.sha512 > /dev/null 2>&1 +checkcode $? + +printf "Checking signature against provided public key... " +ssh-keygen -Y verify -f "./anonymous_signer" -I "anonymous" -n "file-integrity" -s contents.7z.sig < contents.7z > /dev/null > /dev/null > /dev/null 2>&1 +checkcode $?