Is there a simple method that can allow for xor encryption on python? What I want to do is pass a file into the method along with the key or integrate the key into the method.

I have seen the ones on google, but they don't really work. The long one only accepts certain file types, and the second one doesn't work at all.

I appreciate all the help!