From 2e5d9cb5fddf748b05dfaab73124c6f47f5993ed Mon Sep 17 00:00:00 2001 From: dschaft Date: Thu, 9 Apr 2026 07:19:35 +0200 Subject: [PATCH] the actual xor --- theXORitself | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 theXORitself diff --git a/theXORitself b/theXORitself new file mode 100644 index 0000000..ed9e2b0 --- /dev/null +++ b/theXORitself @@ -0,0 +1,18 @@ +>>> a = "a133efb38766" +>>> b = "a0a1a2a3a5a7" +>>> a.encode().hex() +'613133336566623338373636' +>>> bytes1 = bytes.fromhex( a.encode("utf-8").hex()) +>>> bytes2 = bytes.fromhex( b.encode("utf-8").hex()) +>>> xored = bytes( b1 ^ b2 for b1,b2 in zip(bytes1,bytes2)) +>>> xored.hex() +'000152020454030059025701' + +>>> for c,d in zip(bytes1,bytes2): +... e.append( ( c ^ d ) ) +... +>>> e +bytearray(b'\x00\x01R\x02\x04T\x03\x00Y\x02W\x01') +>>> e.hex() +'000152020454030059025701' +