Open hillol3786 opened 5 years ago
Looks like your encryption mechanism is broken. PDF is a binary format, not a text format. But your encryption mechanism outputs a text file.
Use this function instead.
def xor_encrypt(bytes_data: bytes, secret_key: str) -> bytes:
return bytes((x ^ y) for (x, y) in zip(bytes_data, cycle(secret_key.encode())))
my python 3 script:
Normal File: math.pdf
Encrypted File: xor_math.pdf Encryption key : 'abcd'
I cloned the example app and pasted the encrypted file(xor_math.pdf) in asset and changed the file name in code as shown below.
I got this error