There are two different situations. 1. Preservation from the initial capture device (camera or scanner). 2. Documentation of enhancements. When dealing with a camera, RAW files serve as a digital negative, but if RAW files were not captured it is important to document that these images have not changed so write protecting and Hashing the files after capture is one way to do this. When dealing with image enhancements an audit trail (such as a history file) is important. If you question refers to how to detect image tampering, that is too lengthy of a subject for this forum but a good book on the subject was written by Hany Farid called "Photo Forensics" https://www.amazon.com/Photo-Forensics-Press-Hany-Farid/dp/0262035340 . Also there is a good manual on various techniques at http://metainventions.com/products.html .