Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (14 sloc) 584 Bytes
#! /usr/bin/python
# Allows for repeated decoding of base64 string
# How to use: python decodeBase64.py [encoded string] [integer] or after running chmod +x asciify.py, then ./decodeBase64.py [encoded string] [integer]
import sys
import base64
def decode(encoded, times=1):
for i in range(0, times):
encoded = base64.b64decode(encoded)
print(encoded.decode())
if __name__ == "__main__":
try:
decode(sys.argv[1], int(sys.argv[2]))
except:
print("Error: please pass in the string as the first argument and a integer as the second argument.")