Last active
June 16, 2018 12:06
-
-
Save dallas-x/0d9ebf0c8862383dab3d3b8e3e7edf49 to your computer and use it in GitHub Desktop.
Decode txt file n number of times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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