mirror of
https://git.ugnet.gay/CrossTalk/azul.git
synced 2026-11-25 08:40:05 +00:00
13 lines
342 B
Python
13 lines
342 B
Python
from itertools import cycle
|
|
|
|
ROAST_STRING = b'Tic/Toc'
|
|
|
|
def roast(password: bytes) -> bytes:
|
|
chars = cycle(ROAST_STRING)
|
|
return bytes(byte ^ next(chars) for byte in password)
|
|
|
|
def unroast_hex(roasted: bytes) -> bytes:
|
|
text = roasted.decode('ascii', 'replace')
|
|
if text.startswith('0x'):
|
|
text = text[2:]
|
|
return roast(bytes.fromhex(text)) |