|
|
@ -1,5 +1,5 @@
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
import sys, string, types, hashlib, base64, re, urllib, binascii
|
|
|
|
import sys, string, types, hashlib, base64, re, binascii
|
|
|
|
import operator
|
|
|
|
import operator
|
|
|
|
from collections import Counter
|
|
|
|
from collections import Counter
|
|
|
|
|
|
|
|
|
|
|
@ -162,7 +162,7 @@ def resolveZeroWidthString(inputstring):
|
|
|
|
charfound = False
|
|
|
|
charfound = False
|
|
|
|
binarystring = ''
|
|
|
|
binarystring = ''
|
|
|
|
resultstring = ''
|
|
|
|
resultstring = ''
|
|
|
|
inputstring = inputstring.decode('utf-8')
|
|
|
|
#inputstring = inputstring.decode('utf-8')
|
|
|
|
for char in inputstring:
|
|
|
|
for char in inputstring:
|
|
|
|
if char == u'\u200b':
|
|
|
|
if char == u'\u200b':
|
|
|
|
binarystring += '1'
|
|
|
|
binarystring += '1'
|
|
|
@ -204,8 +204,9 @@ def hammingDistance(string1, string2):
|
|
|
|
return diffs
|
|
|
|
return diffs
|
|
|
|
|
|
|
|
|
|
|
|
def urlEncoder():
|
|
|
|
def urlEncoder():
|
|
|
|
input = input('Pleae input your String: ')
|
|
|
|
import urllib.parse
|
|
|
|
print(urllib.quote_plus(input))
|
|
|
|
url = input('Pleae input your String: ')
|
|
|
|
|
|
|
|
print(urllib.parse.quote(url))
|
|
|
|
|
|
|
|
|
|
|
|
def reverser():
|
|
|
|
def reverser():
|
|
|
|
string = input('Please input your string to reverse: ')
|
|
|
|
string = input('Please input your string to reverse: ')
|
|
|
@ -232,7 +233,7 @@ def base64prompt():
|
|
|
|
if (re.match(b64regex, inputString)):
|
|
|
|
if (re.match(b64regex, inputString)):
|
|
|
|
print(base64.b64decode(inputString))
|
|
|
|
print(base64.b64decode(inputString))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print(base64.b64encode(inputString))
|
|
|
|
print(base64.b64encode(inputString.encode()))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def rotPrompt():
|
|
|
|
def rotPrompt():
|
|
|
@ -283,7 +284,7 @@ def hashPrompt():
|
|
|
|
inputString = input('Please input a string: ')
|
|
|
|
inputString = input('Please input a string: ')
|
|
|
|
hasher.update(inputString.encode('utf-8'))
|
|
|
|
hasher.update(inputString.encode('utf-8'))
|
|
|
|
print(hasher.hexdigest())
|
|
|
|
print(hasher.hexdigest())
|
|
|
|
|
|
|
|
def main():
|
|
|
|
print('Welcome aboard PankiCrypt Airlines!')
|
|
|
|
print('Welcome aboard PankiCrypt Airlines!')
|
|
|
|
print('How may we serve you today?')
|
|
|
|
print('How may we serve you today?')
|
|
|
|
print('1: ROT/Ceasar Encryption')
|
|
|
|
print('1: ROT/Ceasar Encryption')
|
|
|
@ -328,3 +329,7 @@ elif(choice == '11'):
|
|
|
|
i = input('String:')
|
|
|
|
i = input('String:')
|
|
|
|
resolveZeroWidthString(i)
|
|
|
|
resolveZeroWidthString(i)
|
|
|
|
print('Thank you for flying with PankiCrypt Airlines!')
|
|
|
|
print('Thank you for flying with PankiCrypt Airlines!')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
|
|
|
main()
|
|
|
|