Users browsing this thread: 2 Guest(s)
XOR First Bytes of Files Automatically
#4
Quote:Your version has one major problem, that being that it relies on the “header” variable to be of the data type string.
The issue with that is the fact that you can only XOR with integer variables. So, in order to do this calculation, it would be required to change the type of the variable multiple times in the process.

You could use XOR cipher implementation from ReverseBox https://github.com/bartlomiejduda/ReverseBox
to XOR encrypted bytes with a specified key. This will return bytes that can be written to a new file or replaced in the old file.

Here's an example how to decrypt data:
Code:
from reversebox.encryption.encryption_xor_basic import xor_cipher_basic


test_data = b'abcd'
test_key = b'\x3D'
xor_result = xor_cipher_basic(test_data, test_key)
print(xor_result)
Reply
Thanked by:


Messages In This Thread
RE: XOR First Bytes of Files Automatically - by ikskoks - 01-14-2025, 01:35 PM

Forum Jump: