Skip to content

Instantly share code, notes, and snippets.

@dallas-x
Last active June 16, 2018 12:06
Show Gist options
  • Save dallas-x/0d9ebf0c8862383dab3d3b8e3e7edf49 to your computer and use it in GitHub Desktop.
Save dallas-x/0d9ebf0c8862383dab3d3b8e3e7edf49 to your computer and use it in GitHub Desktop.
Decode txt file n number of times
#!/bin/bash
# n can not be greater than 25!
# if you need more than 25 then i would suggest a loop that manipulates a global variable $temp!
decodeFile($n, $file) {
if (n == 0) echo $file
else {
base64 -d $file > $file
echo $(decodeFile($n-1, $file)
}
}
unset initStr
initStr=`cat ./pw_encoded_oneline.txt`
unset $file
$file = `echo $initStr | base64 -w0 -d`
$results = decodeFile(13, $file)
echo $results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment