title: Python: encryption as means to prevent data tampering
body: <p>Many of my company's clients use our data acquisition software in a research basis.  Due to the nature of research in general, some of the clients ask that data is encrypted to prevent tampering -- there could be serious ramifications if their data was shown to be falsified.</p>
  
  <p>Some of our <em>binary</em> software encrypts output files with a password stored in the source, that looks like random characters.  At the software level, we are able to open up encrypted files for read-only operations.  If someone <em>really</em> wanted to find out the password so that they could alter data, it would be possible, but it would be a lot of work.  </p>
  
  <p>I'm looking into using Python for rapid development of another piece of software.  To duplicate the functionality of encryption to defeat/discourage data tampering, the best idea I've come up with so far is to just use <code>ctypes</code> with a DLL for file reading/writing operations, so that the method of encryption and decryption is "sufficiently" obfuscated.</p>
  
  <p>We are well aware that an "uncrackable" method is unattainable, but at the same time I'm obviously not comfortable with just having the encryption/decryption approaches sitting there in plain text in the Python source code. A "very strong discouragement of data tampering" would be good enough, I think.</p>
  
  <p><strong>What would be the best approach to attain a happy medium of encryption or other proof of data integrity using Python?</strong>  I saw <a href="https://stackoverflow.com/questions/609127/generating-a-tamper-proof-signature-of-some-data">another post</a> talking about generating a "tamper proof signature", but if a signature was generated in pure Python then it would be trivial to generate a signature for any arbitrary data.  We <em>might</em> be able to phone home to prove data integrity, but that seems like a major inconvenience for everyone involved.</p>