working zero width text hiding yay

py3
7 years ago
commit e425c271c9

@ -106,7 +106,11 @@ def translate(inputString, inputType, outputType):
if (inputType == 5): if (inputType == 5):
for char in inputString: for char in inputString:
if(outputType == 1): if(outputType == 1):
result += bin(ord(char)) + ' ' byte = bin(ord(char))
while len(byte) < 8:
byte = '0' + byte
result += byte + ' '
elif(outputType == 2): elif(outputType == 2):
result += ord(char) + ' ' result += ord(char) + ' '
elif(outputType == 3): elif(outputType == 3):
@ -141,11 +145,11 @@ def translate(inputString, inputType, outputType):
def zeroWidthString(inputstring): def zeroWidthString(inputstring):
resultstring = '>' resultstring = '>'
binary = translate(inputstring, 5, 1) #binary = translate(inputstring, 5, 1)
binaryArray = binary.split(" ") binary = string2bin(inputstring)
print (binaryArray) binaryArray = split_len(binary, 8)
for byte in binaryArray: for byte in binaryArray:
for bit in byte[2:10]: for bit in byte:
if(bit == '1'): if(bit == '1'):
resultstring+= u'\u200b' #zero-width space resultstring+= u'\u200b' #zero-width space
else: else:
@ -157,17 +161,20 @@ def resolveZeroWidthString(inputstring):
charfound = False charfound = False
binarystring = '' binarystring = ''
resultstring = '' resultstring = ''
inputstring = inputstring.decode('unicode-escape') inputstring = inputstring.decode('utf-8')
for char in inputstring: for char in inputstring:
print char
if char == u'\u200b': if char == u'\u200b':
binarystring += '1' binarystring += '1'
elif char == u'\u200d': elif char == u'\u200d':
binarystring += '0' binarystring += '0'
for byte in binarystring[::8]: bytelist = split_len(binarystring, 8)
for byte in bytelist:
resultstring += translate(byte, 1, 5) resultstring += translate(byte, 1, 5)
print resultstring print resultstring
def split_len(seq, length):
return [seq[i:i+length] for i in range(0, len(seq), length)]
def vignere(plain, key): def vignere(plain, key):
i = 0 i = 0
result = '' result = ''
@ -320,4 +327,3 @@ elif(choice == '11'):
i = raw_input('String:') i = raw_input('String:')
resolveZeroWidthString(i) resolveZeroWidthString(i)
print('Thank you for flying with PankiCrypt Airlines!') print('Thank you for flying with PankiCrypt Airlines!')

Loading…
Cancel
Save