From 0ad0c18f8f6bbb50b157e8a8f29dadbf28bae752 Mon Sep 17 00:00:00 2001 From: john Date: Tue, 16 Apr 2019 12:22:54 -0400 Subject: [PATCH 1/2] decodeFunction.py --- decodeFunction.py | 84 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 decodeFunction.py diff --git a/decodeFunction.py b/decodeFunction.py new file mode 100644 index 0000000..bc9ce73 --- /dev/null +++ b/decodeFunction.py @@ -0,0 +1,84 @@ +import string +import binascii +import math +import secrets +b64dict=dict() + +base64library=["0", +"1", +"2", +"3", +"4", +"5", +"6", +"7", +"8", +"9", +"A", +"B", +"C", +"D", +"E", +"F", +"G", +"H", +"I", +"J", +"K", +"L", +"M", +"N", +"O", +"P", +"Q", +"R", +"S", +"T", +"U", +"V", +"W", +"X", +"Y", +"Z", +"!", +'"', +"#", +"$", +"%", +"&", +"'", +"(", +")", +"*", +"+", +",", +"-", +".", +"/", +":", +";", +"<", +"=", +">", +"?", +"@", +"[", +"\\", +"]", +"^", +"_", +"`"] +for i in range(len(base64library)): + b64dict[base64library[i]]=i + +def decodeAsBin(string): + output=[] + print(len(string)) + for j in range(len(string)): + + if(string[j]!=' '): + output.append(bin(b64dict[string[j].upper()])[2:].zfill(6)) + + return output + +print(decodeAsBin('hello world')) From 6d5a242b7a948c3e903e5a894ca174ba2df9cb02 Mon Sep 17 00:00:00 2001 From: john Date: Tue, 16 Apr 2019 23:18:46 -0400 Subject: [PATCH 2/2] added decode function in to base64decode.py --- .idea/hatnotation.iml | 11 +++ .idea/misc.xml | 4 + .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 169 ++++++++++++++++++++++++++++++++++++++++++ base64decode.py | 97 ++++++------------------ decodeFunction.py | 84 --------------------- 7 files changed, 221 insertions(+), 158 deletions(-) create mode 100644 .idea/hatnotation.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml delete mode 100644 decodeFunction.py diff --git a/.idea/hatnotation.iml b/.idea/hatnotation.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/hatnotation.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..65531ca --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..44f6d3b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..0236722 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +