just for now
This commit is contained in:
@ -46,18 +46,19 @@ async def handle_client(client_reader: StreamReader, client_writer: StreamWriter
|
||||
return
|
||||
match resp.split(';'):
|
||||
case [e, n]:
|
||||
if not e.isdigit() or not n.isdigit():
|
||||
if not e.isdigit() or not n.isdigit(): # has to be not
|
||||
client_writer.write('Invalid input\n'.encode())
|
||||
await client_writer.drain()
|
||||
return
|
||||
e, n = int(e), int(n)
|
||||
if not (no_bits * 2 - 1 <= n.bit_length() <= no_bits * 2):
|
||||
if not (no_bits * 2 - 1 <= n.bit_length() <= no_bits * 2): # has to be not
|
||||
client_writer.write('Wrong bit count\n'.encode())
|
||||
await client_writer.drain()
|
||||
return
|
||||
flag = subprocess.check_output('flag').decode().strip()
|
||||
flag = "flaggy"
|
||||
m = int.from_bytes(flag.encode(), 'big')
|
||||
c = pow(m, e, n)
|
||||
print(c)
|
||||
client_writer.write(f'{c}\n'.encode())
|
||||
case _:
|
||||
client_writer.write('Invalid input\n'.encode())
|
||||
|
Reference in New Issue
Block a user