Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions EncryptedStrings_Bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
function GenerateEncryptedString() {
# Usage ~$ GenerateEncryptedString "String"
local STRING="${1}"
local SALT=$(openssl rand -hex 8)
local K=$(openssl rand -hex 12)
local ENCRYPTED=$(echo "${STRING}" | openssl enc -aes256 -md md5 -a -A -S "${SALT}" -k "${K}")
local SALT=$(/usr/bin/openssl rand -hex 8)
local K=$(/usr/bin/openssl rand -hex 12)
local ENCRYPTED=$(echo "${STRING}" | /usr/bin/openssl enc -aes256 -md md5 -a -A -S "${SALT}" -k "${K}")
echo "Encrypted String: ${ENCRYPTED}"
echo "Salt: ${SALT} | Passphrase: ${K}"
}
Expand All @@ -28,4 +28,4 @@ function DecryptString() {
local SALT=""
local K=""
echo "${1}" | /usr/bin/openssl enc -aes256 -md md5 -d -a -A -S "$SALT" -k "$K"
}
}