Tamper-proofing log files
"Efﬁcient, Compromise Resilient and Append-only

Cryptographic Schemes for Secure Audit Logging" ​ (PDF)

gives a publicly verifiable approach that allows fine-grained verification,

but it is in the Random Oracle Model.

The Simple Method:

The verifier and logger start with a seed for a

forward-secure pseudo-random number generator.

To denote a valid ending of a log, put the string of

the next $b$ bits of the PRNG's output into the log.

To add a log entry, get the next $\:b+k\:$ bits of the PRNG's output,

put into the log the encryption of the log entry and the mac of that

ciphertext using the last $k$ of the $\:b+k\:$ bits of PRNG output as the

mac key, then erase those $\:b+k\:$ bits and the previous PRNG state.