e = ((p-1)*(q-1)+4)//8 m = "" for x in d: k = pow(x, e, p*q) if pow(k, 2, p*q) == x: m += "0" else: m += "1" print (m) m=int(m,2) print(long_to_bytes(m))
def binToString(binNum): def binToDec(binNum): decNum = 0 power = 0 while binNum > 0: decNum += 2**power * (binNum % 10) binNum //= 10 power += 1 return decNum binString = '0' + str(binNum) result = "" for j in [binString[i:i+8] for i in range(0,len(binString),8)]: result += chr(int(binToDec(int(j)))) return result a=binToString(11001100110110001100001011001110111101101100010011001000011010001100110001100010011011100111001001100000010110101100110001101000110000100110010001011010011010000111001001100000011010000101101011000100011010001100100001100100010110100111000011001000110001000111000011000100011001000110100011001100110010000111000001101100011010001111101) print (a)
a=[102,108,97,103,123,119,104,48,51,118,51,114,95,100,49,103,53,95,49,110,55,48,95,49,55,95,102,49,110,100,53,95,55,104,51,95,55,114,117,55,104,125] b='' for i in range(len(a)): #print (a[i]) b+=chr(a[i]) print (b)