From 482107a260917c96cf7b53d246a97dcfcc2d5328 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Fri, 27 Mar 2026 19:27:28 -0600 Subject: [PATCH] sum crypto shit and poasscheck --- customscripts/argonproofs | 61 ++++++++++++++++++++++++++++++++++++ customscripts/passcheck | 55 +++++++++++++++++++++++++++++++++ customscripts/sha512proofs | 63 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 customscripts/argonproofs create mode 100644 customscripts/passcheck create mode 100644 customscripts/sha512proofs diff --git a/customscripts/argonproofs b/customscripts/argonproofs new file mode 100644 index 0000000..2803188 --- /dev/null +++ b/customscripts/argonproofs @@ -0,0 +1,61 @@ +#!/bin/bash +# PACKAGES NEEDDED: argon2, cracklib-check, xxd? + +time_cost=3 # time cost (iterations) +memory_cost=16 # 2^n KiB ex 16 = 64 MiB (mem usage) +paralellization_cost=1 # threads +salt_min_length=40 + +read -p "Input File to prove authorship of:" file +if [ ! -f "$file" ]; then + echo "$file not found!" + exit 1 +else + echo "File: OK" + file=$(realpath $file) +fi + +# gather salt +read -s -p "Input Secret Salt" salt1 +read -s -p "Re-Enter Secret Salt" salt2 +## Sanity check the salt +### not empty +if [ -z "$salt1" -o -z "$salt2" ]; then + echo "Input salts can NOT be blank!" + exit 1 +else + echo "Salt Supplied: OK" +fi +### match +if [[ "$salt1" != "$salt2" ]]; then + echo "Salts DO NOT MATCH" + exit 1 +else + echo "Salts match: OK" +fi +### length +salt_length=${#salt1} # salt len +if [[ $salt_length -le $salt_min_length ]]; then + echo "Salt MUST be $salt_min_length characters or longer!" + exit 1 +else + echo "Salt Length: OK" +fi +### salt safety and complexity +complexity_check=$(echo -n "$salt1" | cracklib-check) +if grep -q 'OK' <<< "$complexity_check"; then + echo "Complexity: OK" +else + echo "Salt NOT Complex enough!" + exit 1 +fi + +argon2 "$salt1" -id -t $time_cost -m $memory_cost -p $paralellization_cost -e + < "$file" + +## cleanup +unset $salt1 +unset $salt2 +unset $salt_length +echo "DONE" +exit 0 diff --git a/customscripts/passcheck b/customscripts/passcheck new file mode 100644 index 0000000..4598a9e --- /dev/null +++ b/customscripts/passcheck @@ -0,0 +1,55 @@ +#!/bin/bash +pass_min_length=40 +hibp_api="https://api.pwnedpasswords.com/range/" + +# gather salt +read -s -p "Input Passphrasse " passphrase1 +echo +read -s -p "Re-Enter Passphrase " passphrase2 +echo +## Sanity check the salt +### not empty +if [ -z "$passphrase1" -o -z "$passphrase2" ]; then + echo "Input passphrases can NOT be blank!" + exit 1 +else + echo "Passphrases Supplied: OK" +fi +### match +if [[ "$salt1" != "$salt2" ]]; then + echo "Passphrases DO NOT MATCH" + exit 1 +else + echo "Passphrases Match: OK" +fi +### length +pass_length=${#passphrase1} # salt len +if [[ $pass_length -le $pass_min_length ]]; then + echo "Salt MUST be $pass_min_length characters or longer!" + exit 1 +else + echo "Pass Length: OK" +fi +### salt safety and complexity +complexity_check=$(echo -n "$passphrase1" | cracklib-check) +if grep -q 'OK' <<< "$complexity_check"; then + echo "Complexity: OK" +else + echo "Passphrase NOT Complex enough!" + exit 1 +fi +### query hibP +sha1_digest=$(echo -n "$passphrase1" | sha1sum | awk '{print $1}') +first_five="${sha1_digest:0:5}" # get furst five chars +last_35="${sha1_digest:5:35}" # get the rest +curl_ret="$(curl -s ${hibp_api}${first_five})" +# echo "first five: $first_five" +# echo "last 35: $last_35" +# echo "curl ret: $curl_ret" +if grep -q -i "${last_35}" <<< "${curl_ret}"; then + echo "PASS FOUND IN BREACHED LISTS!" + exit 1 +else + echo "PASS CHECKS OUT" + exit 0 +fi \ No newline at end of file diff --git a/customscripts/sha512proofs b/customscripts/sha512proofs new file mode 100644 index 0000000..2475930 --- /dev/null +++ b/customscripts/sha512proofs @@ -0,0 +1,63 @@ +#!/bin/bash +# packages neededed: xxd +# get da file +read -p "Input File to prove authorship of: " file +## sanity check da file +if [ ! -f "$file" ]; then + echo "$file not found!" + exit 1 +else + echo "File: OK" + file=$(realpath $file) +fi +echo + +# gather salt +read -s -p "Input Secret Salt " salt1 +echo +read -s -p "Re-Enter Secret Salt " salt2 +echo +## Sanity check the salt +### not empty +if [ -z "$salt1" -o -z "$salt2" ]; then + echo "Input salts can NOT be blank!" + exit 1 +else + echo "Salt Supplied: OK" +fi +### match +if [[ "$salt1" != "$salt2" ]]; then + echo "Salts DO NOT MATCH" + exit 1 +else + echo "Salts match: OK" +fi +### length +salt_length=${#salt1} # salt len +if [[ $salt_length -le $salt_min_length ]]; then + echo "Salt MUST be $salt_min_length characters or longer!" + exit 1 +else + echo "Salt Length: OK" +fi +### salt safety and complexity +complexity_check=$(echo -n "$salt1" | cracklib-check) +if grep -q 'OK' <<< "$complexity_check"; then + echo "Complexity: OK" +else + echo "Salt NOT Complex enough!" + exit 1 +fi + +# do da hashes +echo -e "\nUnsalted:" +cat "$file" | sha512sum +echo -e "\nSalted:" +echo -n "$(cat $file)$salt1" | sha512sum + +## cleanup +unset $salt1 +unset $salt2 +unset $salt_length +echo -e "\nDONE" +exit 0 \ No newline at end of file