I'm trying to decrypt a OTP. The key is generated with the following code:
class OTPGenerator(metaclass=Singleton):
_OTP_LEN = 128
def __init__(self):
self.otp = os.urandom(OTPGenerator._OTP_LEN)
def get_otp(self):
return self.otp
I get receive the encrypted text thru a socket connection:
b'7Vf\xba\xe1\xb1.\xeb\x05Y\xccL 1\xb2\xec\xb1<0\xb36\xce\xc3\x02\xd6^\xc6z\x15_\x88\x14k\xe9\x8c\xb1\xa5{\xd5\xe3LKE8\x16\xe2\xe1\xf0\xe1+[_\xd47\x13\xd8T\xa7E\x8f\xf3SR\xd1'
And another encrypted text given by be as plaintext:
input = flag
Encrypted Input: b'\t\x17J\x9c'
I'm trying to decode them before XOR-ing them, but they are casted as strings.
Has anyone encountered a similar issue before?