The only part that I needed to fix was making sure file_data and data in the xor function were the same. ...
stackoverflow.com