Create a “For” loop that encodes the variable “var” 28 times in “base64”. The number of characters in the 28th hash is the value that must be assigned to the “salt” variable.
No matter what I put, I always get a ‘bad decrypt’ back. My answer is:
for i in {1..28}
do
var=$(echo $var | base64)
if [[ $i == 28 ]]
then
salt=$(echo $var | wc -c)
fi
done
...
Does anyone have any insight to this. I have looked at StackOverFlow and on here, and there is nothing that insightful, apart from people saying that the questions is poorly worded, but thats to be expected with HTB at this point ha!!
Any help or light anyone can shed on this, would be highly appreciated xx
The command echo XYZ sends XYZ and a newline character to stdout. Therefore, echo $var sends the content of the variable var and a newline character to stdout. But you need only the content of the variable var base64 encoded.