You want to ensure that a file or combination of data files cannot be undetectably altered.
Use a HashAlgorithm class to create a hash code based on the data, and store this hash code to use for future comparisons.
Encryption prevents malicious users from reading your data, but it doesn’t stop them from tampering with it. Instead, you need a way to validate data and detect whether it has been altered. This is the role played by hash codes.
A hash code algorithm generates a small (typically about 20-byte) binary fingerprint for any data that can be represented as a sequence of bytes. Hash codes are cryptographically secure, which means that it’s extremely difficult for a malicious user to create ...